zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Re: parameter frag K
@ 2000-01-28 13:08 Sven Wischnowsky
  0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-01-28 13:08 UTC (permalink / raw)
  To: zsh-workers


Tanaka Akira wrote:

> I found a problem of the parameter frag K.
> 
> Z(2):akr@is27e1u11% Src/zsh -f
> is27e1u11% t='['
> is27e1u11% typeset -A a
> is27e1u11% a=('\[' x)
> is27e1u11% print -lr - $a[(K)$t]     
> 
> is27e1u11% 
> 
> This should print `x'.

Small tokenization problem here...

Bye
 Sven

diff -ru ../z.old/Src/params.c Src/params.c
--- ../z.old/Src/params.c	Fri Jan 28 10:23:25 2000
+++ Src/params.c	Fri Jan 28 14:05:28 2000
@@ -376,6 +376,7 @@
 	char *tmp = dupstring(v.pm->nam);
 
 	tokenize(tmp);
+	remnulargs(tmp);
 
 	if (!(prog = patcompile(tmp, 0, NULL)) || !pattry(prog, scanstr))
 	    return;
@@ -966,9 +967,10 @@
 		if (ishash) {
 		    scanprog = pprog;
 		    scanstr = s;
-		    if (keymatch)
+		    if (keymatch) {
+			untokenize(s);
 			v->isarr |= SCANPM_KEYMATCH;
-		    else if (ind)
+		    } else if (ind)
 			v->isarr |= SCANPM_MATCHKEY;
 		    else
 			v->isarr |= SCANPM_MATCHVAL;

--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-01-28 13:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-01-28 13:08 PATCH: Re: parameter frag K Sven Wischnowsky

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).