about summary refs log tree commit diff
path: root/Src/glob.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2005-01-10 17:31:07 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2005-01-10 17:31:07 +0000
commita92d2d84c01b01882133ea508c043ea11de07271 (patch)
treec86741256456454075d60870aae3cc708564d6fc /Src/glob.c
parent90402714926f39359eb73417fcdfbcd9704f6788 (diff)
downloadzsh-a92d2d84c01b01882133ea508c043ea11de07271.tar.gz
zsh-a92d2d84c01b01882133ea508c043ea11de07271.tar.xz
zsh-a92d2d84c01b01882133ea508c043ea11de07271.zip
20661: *(+func) = *(e:func:)
Diffstat (limited to 'Src/glob.c')
-rw-r--r--Src/glob.c31
1 files changed, 26 insertions, 5 deletions
diff --git a/Src/glob.c b/Src/glob.c
index 5519e0e02..c1f2fc0dc 100644
--- a/Src/glob.c
+++ b/Src/glob.c
@@ -1426,22 +1426,43 @@ zglob(LinkList list, LinkNode np, int nountok)
 		    s++;
 		    break;
 		}
+		case '+':
 		case 'e':
 		{
-		    char sav, *tt = get_strarg(s);
+		    char sav, *tt;
+		    int plus;
+
+		    if (s[-1] == '+') {
+			plus = 0;
+			tt = s;
+			while (iident(*tt))
+			    tt++;
+			if (tt == s)
+			{
+			    zerr("missing identifier after `+'", NULL, 0);
+			    tt = NULL;
+			}
+		    } else {
+			plus = 1;
+			tt = get_strarg(s);
+			if (!*tt)
+			{
+			    zerr("missing end of string", NULL, 0);
+			    tt = NULL;
+			}
+		    }
 
-		    if (!*tt) {
-			zerr("missing end of string", NULL, 0);
+		    if (tt == NULL) {
 			data = 0;
 		    } else {
 			sav = *tt;
 			*tt = '\0';
 			func = qualsheval;
-			sdata = dupstring(s + 1);
+			sdata = dupstring(s + plus);
 			untokenize(sdata);
 			*tt = sav;
 			if (sav)
-			    s = tt + 1;
+			    s = tt + plus;
 			else
 			    s = tt;
 		    }