-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
ls: encode path when using --hyperlink #5629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
17b77fc
to
87db427
Compare
GNU testsuite comparison:
|
a589406
to
33b84fc
Compare
3650355
to
c1a0c45
Compare
is it expected that it does not fix the GNU test? |
@sylvestre yes, unfortunately :| |
c1a0c45
to
3aa37cc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! That's looking great! One final question but ready to be merged I think.
src/uu/ls/src/ls.rs
Outdated
#[cfg(not(target_os = "windows"))] | ||
let unencoded_chars = "_-.:~/"; | ||
#[cfg(target_os = "windows")] | ||
let unencoded_chars = "_-.:~\\"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should've asked this on the previous review, but did you check GNU for the backslash? I think maybe Windows either needs both back and forward slash (because both are allowed) or only forward slash because that matches the spec (as explained on the wikipedia page: https://en.wikipedia.org/wiki/Percent-encoding). Although of course maybe the way GNU does it is different from the spec that wikipedia describes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GNU encodes backslashes. And as Windows uses backslashes in paths I thought it doesn't make sense to encode them on Windows. It's guess work from my side, as I don't know Windows. In the latest push I added the forward slash to unencoded_chars
.
3aa37cc
to
89cb4ac
Compare
This PR encodes special characters in a path when using
--hyperlink
.