Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Doc fix for :s/l/r/ modifier
- X-seq: zsh-workers 194
- From: hzoli@xxxxxxxxxx (Zoltan Hidvegi)
- To: kaefer@xxxxxxxxxxxxxxx (Thorsten Meinecke)
- Subject: Re: Doc fix for :s/l/r/ modifier
- Date: Mon, 10 Jul 1995 19:55:42 +0100 (MET DST)
- In-reply-to: <m0sULiv-00000PC@xxxxxxxxxxxxxxx> from "Thorsten Meinecke" at Jul 8, 95 00:18:11 am
- Sender: hzoli@xxxxxxxxxx
Thorsten Meinecke wrote:
> Since aeons, the error message for `!:s//r/' (and no previous match) is:
>
> zsh: no previous substitution with &
>
> This is at least confusing for the casual user.
If this substitution gives an error, then the parameter modifier sould also
give error. Here is a patch for that. It depends on my previous patch for
:s//r/ (art. 176).
Zoltan
*** 1.13 1995/07/07 15:59:57
--- Src/subst.c 1995/07/10 17:51:04
***************
*** 1476,1485 ****
zsfree(hsubl);
hsubl = ztrdup(ptr1);
}
! if (hsubl)
! for (tt = hsubl; *tt; tt++)
! if (INULL(*tt))
! chuck(tt);
for (tt = hsubr = ztrdup(ptr2); *tt; tt++)
if (INULL(*tt))
chuck(tt);
--- 1476,1488 ----
zsfree(hsubl);
hsubl = ztrdup(ptr1);
}
! if (!hsubl) {
! zerr("no previous substitution", NULL, 0);
! return;
! }
! for (tt = hsubl; *tt; tt++)
! if (INULL(*tt))
! chuck(tt);
for (tt = hsubr = ztrdup(ptr2); *tt; tt++)
if (INULL(*tt))
chuck(tt);
Messages sorted by:
Reverse Date,
Date,
Thread,
Author