Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: 3.1.5-pws-14: Re: bar='#pat'; ${foo/$bar/...} problem
- X-seq: zsh-workers 6002
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: "ZSH workers mailing list" <zsh-workers@xxxxxxxxxxxxxx>
- Subject: PATCH: 3.1.5-pws-14: Re: bar='#pat'; ${foo/$bar/...} problem
- Date: Fri, 2 Apr 1999 03:13:21 -0800
- In-reply-to: <990402023951.ZM769@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
- References: <002e01be7c48$968d8860$21c9ca95@xxxxxxxxxxxxxxx> <990402023951.ZM769@xxxxxxxxxxxxxxxxxxxxxxx>
On Apr 2, 2:39am, Bart Schaefer wrote:
} Subject: Re: bar='#pat'; ${foo/$bar/...} problem
}
} Now, you might argue that the implementation of /# and /% should be as
} if # and % are extensions of the glob syntax
Index: Src/subst.c
===================================================================
--- subst.c 1999/03/29 21:45:50 1.22
+++ subst.c 1999/04/02 11:06:21
@@ -1361,7 +1361,19 @@
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++;
+ }
+ }
+ }
if (!vunset && isarr) {
char **ap = aval;
} (Did I get to be article 6000? :-)
(Hopefully, I did a better job of patching than I did of noticing which
message's headers I was reading the X-Seq: from. Hard to be 6000 when
that's the one you're replying to.)
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Messages sorted by:
Reverse Date,
Date,
Thread,
Author