From 8ceb54fbc2f879e0e80f58c18761bd54db07e5f7 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 15 Apr 1999 18:25:40 +0000 Subject: zsh-3.1.5-pws-15 --- Src/subst.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'Src/subst.c') diff --git a/Src/subst.c b/Src/subst.c index c62fcce6b..e8e22f943 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -1361,16 +1361,24 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int ssub) NULL, s[-1]); return NULL; } - singsub(&s); + { + char t = s[-1]; + + singsub(&s); + if (t == '/' && (flags & SUB_SUBSTR)) { + if (*s == '#' || *s == '%') { + flags &= ~SUB_SUBSTR; + if (*s == '%') + flags |= SUB_END; + s++; + } else if (*s == '\\') { + s++; + } + } + } if (!vunset && isarr) { - char **ap = aval; - char **pp = aval = (char **)ncalloc(sizeof(char *) * (arrlen(aval) + 1)); - - while ((*pp = *ap++)) { - if (getmatch(pp, s, flags, flnum, replstr)) - pp++; - } + getmatcharr(&aval, s, flags, flnum, replstr); copied = 1; } else { if (vunset) -- cgit 1.4.1