summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorBart Schaefer <barts@users.sourceforge.net>2010-12-15 04:05:50 +0000
committerBart Schaefer <barts@users.sourceforge.net>2010-12-15 04:05:50 +0000
commit66152e8adad7b00935c0b5fbe0cf0a7df3c639c7 (patch)
tree22989e2e4d08801483a658fb8414da3e7a143a17 /Src
parentef5cf45780f83630e36a8b9bee370d88fddb6610 (diff)
downloadzsh-66152e8adad7b00935c0b5fbe0cf0a7df3c639c7.tar.gz
zsh-66152e8adad7b00935c0b5fbe0cf0a7df3c639c7.tar.xz
zsh-66152e8adad7b00935c0b5fbe0cf0a7df3c639c7.zip
28530: replace (z+opts+) flag with (Z:opts:), add reserved (_:flags:).
Diffstat (limited to 'Src')
-rw-r--r--Src/subst.c42
1 files changed, 34 insertions, 8 deletions
diff --git a/Src/subst.c b/Src/subst.c
index 7ad4aecdf..24d515d06 100644
--- a/Src/subst.c
+++ b/Src/subst.c
@@ -1936,10 +1936,15 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 
 		case 'z':
 		    shsplit = LEXFLAGS_ACTIVE;
-		    if (s[1] == '+') {
-			s += 2;
-			while (*s && *s != '+' && *s != ')' && *s != Outpar) {
-			    switch (*s++) {
+		    break;
+
+		case 'Z':
+		    t = get_strarg(++s, &arglen);
+		    if (*t) {
+			sav = *t;
+			*t = 0;
+			while (*++s) {
+			    switch (*s) {
 			    case 'c':
 				/* Parse and keep comments */
 				shsplit |= LEXFLAGS_COMMENTS_KEEP;
@@ -1956,12 +1961,14 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 				break;
 
 			    default:
-				goto flagerr;
+				*t = sav;
+ 				goto flagerr;
 			    }
 			}
-			if (*s != '+')
-			    goto flagerr;
-		    }
+			*t = sav;
+			s = t + arglen - 1;
+		    } else
+			goto flagerr;
 		    break;
 
 		case 'u':
@@ -1973,6 +1980,25 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub)
 		    evalchar = 1;
 		    break;
 
+		case '_':
+		    t = get_strarg(++s, &arglen);
+		    if (*t) {
+			sav = *t;
+			*t = 0;
+			while (*++s) {
+			    /* Reserved for future use */
+			    switch (*s) {
+			    default:
+				*t = sav;
+				goto flagerr;
+			    }
+			}
+			*t = sav;
+			s = t + arglen - 1;
+		    } else
+			goto flagerr;
+		    break;
+
 		default:
 		  flagerr:
 		    zerr("error in flags");