diff options
| author | Bart Schaefer <schaefer@zsh.org> | 2024-01-05 20:38:58 -0800 |
|---|---|---|
| committer | Bart Schaefer <schaefer@zsh.org> | 2024-01-05 20:38:58 -0800 |
| commit | d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725 (patch) | |
| tree | 17e0b496d09c024cfa729eba8aee84c708a1b893 /Functions/Misc | |
| parent | 52413: support Citrus version of iconv on macOS, DragonFly, NetBSD (diff) | |
| download | zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.tar zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.tar.gz zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.tar.bz2 zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.tar.lz zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.tar.xz zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.tar.zst zsh-d6e4ddd4d48b6ac9c0a29b95e0e2fc0e6012d725.zip | |
52465: use NULL_GLOB when expanding zmv input pattern to avoid NOMATCH exit
Diffstat (limited to 'Functions/Misc')
| -rw-r--r-- | Functions/Misc/zmv | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Functions/Misc/zmv b/Functions/Misc/zmv index 269fe5ba5..5c03e9ea1 100644 --- a/Functions/Misc/zmv +++ b/Functions/Misc/zmv @@ -236,12 +236,18 @@ if [[ $pat = (#b)(*)\((\*\*##/)\)(*) ]]; then else fpat=$pat fi -files=(${~fpat}) [[ -n $hasglobqual ]] && pat=$opat errs=() +() { + # (#qN) breaks bareglobqual -Q option, so: + setopt localoptions nullglob + files=(${~fpat}) +} +(( ${#files} )) || errs=( "no files matched \`$fpat'" ) + for f in $files; do if [[ $pat = (#b)(*)\(\*\*##/\)(*) ]]; then # This looks like a recursive glob. This isn't good enough, |
