Skip to content
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

tilde "c:\progra~1\" doesn't work with windowsPathsNoEscape: true #547

Closed
anthony-redFox opened this issue Aug 25, 2023 · 3 comments
Closed

Comments

@anthony-redFox
Copy link

anthony-redFox commented Aug 25, 2023

Pattern c:\progra~1\*.ext with windowsPathsNoEscape: true should works the same as "c:\program files\*.ext"

@isaacs
Copy link
Owner

isaacs commented Aug 30, 2023

Yeah, what's happening there is that it's reading the c:\ directory, and finding ['Program Files'], but testing against the progra~1 doesn't find anything.

What it really should do, which would also have the benefit of being faster in the vast majority of cases, is concatenate all non-magic string portions of the pattern, and just readdir at that first location. Then it'd call readdir on c:\progra~1 in this case, which does return the results expected. Of course, it means you'll get results like c:\progra~1\Whatever, but I assume that's probably fine, yes?

@isaacs
Copy link
Owner

isaacs commented Aug 30, 2023

OH, heh, there's code to do this already, but it's breaking out if we haven't seen the path yet, and it is anything other than '..'. That looks like a mistake.

@isaacs isaacs closed this as completed in 61cc5a2 Aug 30, 2023
@isaacs
Copy link
Owner

isaacs commented Aug 30, 2023

Didn't impact perf to any significant degree that I could determine from the benchmarks, even trying to hand it a benchmark that would benefit as much as possible from the shortcut. I guess readdir is just pretty fast 😅

But fixed on 10.3.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants