summary refs log tree commit diff
path: root/Src/params.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-03-25 17:47:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-03-25 17:47:10 +0000
commit56e1904e45cc474a9858dc1205055008f8c63752 (patch)
tree075e089f92f9916e36feee06c38321c58dd1a97d /Src/params.c
parent238df34af407d755a9c6fc94cade1272c7ea5b62 (diff)
downloadzsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.gz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.xz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.zip
fix optimisation of string matching with multibyte mode
24732: attempt to provide adequate space for sched ztrftime string with
multibyte characters
Diffstat (limited to 'Src/params.c')
-rw-r--r--Src/params.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/Src/params.c b/Src/params.c
index d7135c438..bbacb5476 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -1007,7 +1007,7 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
     int hasbeg = 0, word = 0, rev = 0, ind = 0, down = 0, l, i, ishash;
     int keymatch = 0, needtok = 0, arglen, len;
     char *s = *str, *sep = NULL, *t, sav, *d, **ta, **p, *tt, c;
-    zlong num = 1, beg = 0, r = 0;
+    zlong num = 1, beg = 0, r = 0, quote_arg = 0;
     Patprog pprog = NULL;
 
     ishash = (v->pm && PM_TYPE(v->pm->node.flags) == PM_HASHED);
@@ -1058,8 +1058,7 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
 		sep = "\n";
 		break;
 	    case 'e':
-		/* Compatibility flag with no effect except to prevent *
-		 * special interpretation by getindex() of `*' or `@'. */
+		quote_arg = 1;
 		break;
 	    case 'n':
 		t = get_strarg(++s, &arglen);
@@ -1286,7 +1285,10 @@ getarg(char **str, int *inv, Value v, int a2, zlong *w,
 	    }
 	}
 	if (!keymatch) {
-	    tokenize(s);
+	    if (quote_arg)
+		untokenize(s);
+	    else
+		tokenize(s);
 	    remnulargs(s);
 	    pprog = patcompile(s, 0, NULL);
 	} else