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

Re: [^ax-y] doesn't work but [^x-ya] does



On Mar 8,  7:12pm, Martijn Dekker wrote:
}
} Commit f3f8537c breaks unquoted $-:

We get here:

#0  fetchvalue (v=0xbff07f00, pptr=0xbff07f64, bracks=1, flags=0)
    at ../../zsh-5.0/Src/params.c:1969
#1  0x080de7db in paramsubst (l=0xb7d68778, n=0xb7d68790, str=0xbff07fd8, 
    qt=0, pf_flags=0, ret_flags=0xbff0813c) at ../../zsh-5.0/Src/subst.c:2418
#2  0x080dacff in stringsubst (list=0xb7d68778, node=0xb7d68790, pf_flags=0, 
    ret_flags=0xbff0813c, asssub=0) at ../../zsh-5.0/Src/subst.c:247
#3  0x080da47d in prefork (list=0xb7d68778, flags=0, ret_flags=0xbff0813c)
    at ../../zsh-5.0/Src/subst.c:85

With pptr still pointing at "\233" (Dash).  Hopefully the following
doesn't re-break anything else.

diff --git a/Src/params.c b/Src/params.c
index b89fb74..bee01c5 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1987,7 +1987,9 @@ fetchvalue(Value v, char **pptr, int bracks, int flags)
 	*s++ = '$';
     else if (c == Star)
 	*s++ = '*';
-    else if (c == '#' || c == '-' || c == '?' || c == '$' ||
+    else if (IS_DASH(c))
+    	*s++ = '-';
+    else if (c == '#' || c == '?' || c == '$' ||
 	     c == '!' || c == '@' || c == '*')
 	s++;
     else



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