-
-
Notifications
You must be signed in to change notification settings - Fork 348
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
expand: globstar expansion can return errors or leave leading spaces #829
Comments
Also, it doesn't like sockets. Could be the same bug, though. % gosh
$ pwd
/tmp
$ ls -la
total 0
drwxrwxrwt 10 root wheel 320 Mar 22 08:32 .
drwxr-xr-x 6 root wheel 192 Jan 1 2020 ..
drwx------ 3 lmc wheel 96 Feb 8 09:12 .vbox-lmc-ipc
drwx------ 3 lmc wheel 96 Jan 18 08:59 com.apple.launchd.MaQaVePSF0
drwx------ 3 lmc wheel 96 Jan 18 08:59 com.apple.launchd.Mkn79cVqM0
drwxr-xr-x 2 lmc wheel 64 Mar 19 13:01 com.google.Keystone
drwxr-xr-x 2 lmc wheel 64 Mar 19 13:01 dir
srw------- 1 lmc wheel 0 Mar 19 16:16 drivefs_ipc.501
srw------- 1 lmc wheel 0 Mar 19 16:16 drivefs_ipc.501_shell
drwxr-xr-x 2 root wheel 64 Mar 20 12:26 powerlog
$ echo **
com.apple.launchd.MaQaVePSF0 com.apple.launchd.Mkn79cVqM0 com.google.Keystone dir drivefs_ipc.501 drivefs_ipc.501_shell powerlog
$ shopt -s globstar
$ echo **
open /tmp/drivefs_ipc.501: operation not supported on socket |
Hmm, is this a recent regression? It could be caused by my trick to use ReadDir instead of Stat for globbing. |
Dunno. Haven't played with globbing much. I'm working on completion in my gui shell so now it's coming up a lot more. :)
|
Thanks, I can easily reproduce both failures. The good news is that this is not a regression; I get exactly the same failures if I revert the recent change to replace Stat with ReadDir. |
The previous globstar implementation was breadth-first search, whereas Bash implements depth-first search. Moreover, when recursing into directories, we could stop early and give an error to the user when encountering a non-directory. Instead, we want to simply not recurse into that path. Add tests for both cases, too. Fixes #829.
The previous globstar implementation was breadth-first search, whereas Bash implements depth-first search. Moreover, when recursing into directories, we could stop early and give an error to the user when encountering a non-directory. Instead, we want to simply not recurse into that path. Add tests for both cases, too. Fixes #829.
The previous globstar implementation was breadth-first search, whereas Bash implements depth-first search. Moreover, when recursing into directories, we could stop early and give an error to the user when encountering a non-directory. Instead, we want to simply not recurse into that path. Add tests for both cases, too. Fixes #829.
The previous globstar implementation was breadth-first search, whereas Bash implements depth-first search. Moreover, when recursing into directories, we could stop early and give an error to the user when encountering a non-directory. Instead, we want to simply not recurse into that path. Add tests for both cases, too. Fixes #829.
On macOS, in case it matters (and wasn't obvious from the PWD :).
The text was updated successfully, but these errors were encountered: