Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Recent regression on (N) after removing array element



On Tue, 19 Nov 2013 10:02:22 -0800
Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> } Apart from going back to the original, the only ways round that occur to
> } me involve reparsing on failure, e.g. reinterpreting as glob qualifiers
> } if no matches were found.  But that's probably worse than the original
> } disease.
> 
> Yeah, I think we have to back this one out.

In the absence of immediate smart ideas...

Here's a test so we don't forget.

diff --git a/Src/glob.c b/Src/glob.c
index 385b9e6..e0d0cf6 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1171,7 +1171,7 @@ zglob(LinkList list, LinkNode np, int nountok)
 		break;
 	    }
 	}
-	if (*s != Inpar || s == str)
+	if (*s != Inpar)
 	    break;
 	if (isset(EXTENDEDGLOB) && !zpc_disables[ZPC_HASH] && s[1] == Pound) {
 	    if (s[2] == 'q') {
diff --git a/Test/D02glob.ztst b/Test/D02glob.ztst
index d6ab733..81b0021 100644
--- a/Test/D02glob.ztst
+++ b/Test/D02glob.ztst
@@ -491,3 +491,11 @@
 >@(scrimf), @(scrimf): 0
 >'(' '*' '[' '^' '@('
 >Nothing should be disabled.
+
+  (
+   setopt nomatch
+   x=( '' )
+   print $^x(N)
+  )
+0:No error with empty null glob with (N).
+>

pws



Messages sorted by: Reverse Date, Date, Thread, Author