Skip to content

Remove redundant trailing slash in tilde expansion#166

Merged
magicant merged 1 commit into
trunkfrom
tilde-trailing-slash
May 5, 2025
Merged

Remove redundant trailing slash in tilde expansion#166
magicant merged 1 commit into
trunkfrom
tilde-trailing-slash

Conversation

@magicant

@magicant magicant commented May 2, 2025

Copy link
Copy Markdown
Owner

This pull request addresses a bug in tilde expansion behavior, updates related tests, and adds new test cases to ensure proper functionality. The key changes include modifying the tilde expansion logic to handle trailing slashes correctly, updating test cases to reflect this behavior, and documenting the change in the NEWS files.

Bug Fix in Tilde Expansion:

  • expand.c: Updated the expand_tilde function to remove trailing slashes from directory names produced by tilde expansion when followed by another slash, ensuring the correct number of slashes in the resultant path.

Documentation Updates:

  • NEWS: Added a note describing the change in tilde expansion behavior for cases where a directory name ends with a slash and is followed by another slash.
  • NEWS.ja: Added a Japanese translation of the same documentation update.

Test Case Updates:

  • tests/tilde-p.tst: Added new test cases to verify the updated tilde expansion behavior, including scenarios with HOME set to paths with trailing slashes.
  • tests/function-y.tst: Updated an existing test case to reflect the corrected tilde expansion behavior.
  • tests/param-y.tst: Modified a test case to align with the new behavior, ensuring consistency in the handling of slashes.

@magicant magicant added the enhancement New feature or request label May 2, 2025
@magicant magicant added this to the 2.59 milestone May 2, 2025
@magicant magicant self-assigned this May 2, 2025
@magicant
magicant requested a review from Copilot May 2, 2025 15:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes a bug in tilde expansion that removed a redundant trailing slash when a tilde occurs before another slash, updates test cases to verify the fix, and documents the change in NEWS files.

  • Fixed tilde expansion in expand.c to handle trailing slashes correctly.
  • Updated NEWS files with documentation.
  • Added/adjusted test cases in multiple test files to reflect and verify the new behavior.

Reviewed Changes

Copilot reviewed 1 out of 6 changed files in this pull request and generated 1 comment.

File Description
expand.c Modified tilde expansion logic to remove a redundant slash
NEWS / NEWS.ja Updated documentation to reflect the new behavior
tests/*.tst Added and modified test cases to verify tilde expansion
Files not reviewed (5)
  • NEWS: Language not supported
  • NEWS.ja: Language not supported
  • tests/function-y.tst: Language not supported
  • tests/param-y.tst: Language not supported
  • tests/tilde-p.tst: Language not supported

Comment thread expand.c
@magicant magicant mentioned this pull request May 2, 2025
56 tasks
@magicant
magicant merged commit 2572c2c into trunk May 5, 2025
@magicant
magicant deleted the tilde-trailing-slash branch May 5, 2025 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants