Skip to content

normalize_path: Squash leading slashes even without allow_leading#8281

Merged
faho merged 1 commit into
fish-shell:masterfrom
faho:normalize-leading-slashes
Sep 9, 2021
Merged

normalize_path: Squash leading slashes even without allow_leading#8281
faho merged 1 commit into
fish-shell:masterfrom
faho:normalize-leading-slashes

Conversation

@faho
Copy link
Copy Markdown
Member

@faho faho commented Sep 9, 2021

This currently changes builtin realpath with the "-s" option:

builtin realpath -s ///tmp

previously would print "///tmp", now it prints "/tmp".

The only thing "allow_leading_double_slashes" does is allow two
slashes.

This is important for path match, to be introduced in #8265.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@faho faho added the bug Something that's not working as intended label Sep 9, 2021
@faho faho added this to the fish 3.4.0 milestone Sep 9, 2021
This currently changes builtin realpath with the "-s" option:

    builtin realpath -s ///tmp

previously would print "///tmp", now it prints "/tmp".

The only thing "allow_leading_double_slashes" does is allow *two*
slashes.

This is important for `path match`, to be introduced in fish-shell#8265.
@faho faho force-pushed the normalize-leading-slashes branch from 285904f to dc5f76b Compare September 9, 2021 15:26
@faho
Copy link
Copy Markdown
Member Author

faho commented Sep 9, 2021

Okay, the only use of this is in builtin realpath, all other callsites allow leading double slashes.

So I feel comfortable merging this.

@faho faho merged commit a78d9d8 into fish-shell:master Sep 9, 2021
@faho faho deleted the normalize-leading-slashes branch September 9, 2021 16:41
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Sep 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

bug Something that's not working as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant