Remove redundant trailing slash in tilde expansion#166
Merged
Conversation
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
NEWSfiles.Bug Fix in Tilde Expansion:
expand.c: Updated theexpand_tildefunction 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 withHOMEset 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.