summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
Diffstat (limited to 'Src')
-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;
 		    }