ls: encode path when using --hyperlink#5629
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
tertsdiepraam
left a comment
There was a problem hiding this comment.
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.
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.
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.