Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: reverse string subscripting
- X-seq: zsh-workers 13916
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Re: PATCH: reverse string subscripting
- Date: Fri, 6 Apr 2001 09:35:57 +0200 (MET DST)
- In-reply-to: <1010405180950.ZM9683@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Bart Schaefer wrote:
> ...
>
> Note the (r) is forward pattern matching, not reverse; (R) is reverse.
> Your patch appears to have fixed the bug only for the forward direction:
Ahem.
Bye
Sven
Index: Src/params.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/params.c,v
retrieving revision 1.33
diff -u -r1.33 params.c
--- Src/params.c 2001/04/05 11:24:17 1.33
+++ Src/params.c 2001/04/06 07:35:07
@@ -1118,7 +1118,7 @@
if (a2) {
if (down) {
if (!hasbeg)
- beg = len - 1;
+ beg = len;
for (r = beg, t = d + beg; t >= d; r--, t--) {
sav = *t;
*t = '\0';
@@ -1143,7 +1143,7 @@
} else {
if (down) {
if (!hasbeg)
- beg = len - 1;
+ beg = len;
for (r = beg + 1, t = d + beg; t >= d; r--, t--) {
if (pattry(pprog, t) &&
!--num)
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author