Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: PATCH: Expansion of \c escape sequences
- X-seq: zsh-workers 21513
- From: Wayne Davison <wayned@xxxxxxxxxxxxxxxxxxxxx>
- To: Thorsten Dahlheimer <tdahlheim@xxxxxxx>
- Subject: Re: PATCH: Expansion of \c escape sequences
- Date: Sat, 23 Jul 2005 22:52:20 -0700
- Cc: zsh-workers@xxxxxxxxxx
- In-reply-to: <003c01c58ff5$870469a0$13e6fea9@pcdahl4201>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <003c01c58ff5$870469a0$13e6fea9@pcdahl4201>
Thanks for the \c fixes and your earlier Makefile.in patch -- I've
checked them into CVS (and I improved the function-comment for
getkeystring() while I was at it).
On Sun, Jul 24, 2005 at 04:15:12AM +0200, Thorsten Dahlheimer wrote:
> Finally, I've discovered that \c in an argument to a printing command
> only suppresses the final newline, but according POSIX it should
> suppress all output after the \c, and that's what ksh, bash, and
> echo/printf from GNU coreutils do.
I'm curious which version of coreutils behaves that way? I've got 5.2.1
on my system, and it behaves as zsh does. If we want to change the
behavior, the attached patch should handle it.
..wayne..
--- Src/utils.c 24 Jul 2005 05:19:58 -0000 1.80
+++ Src/utils.c 24 Jul 2005 05:42:08 -0000
@@ -3611,7 +3611,9 @@ getkeystring(char *s, int *len, int from
case 'c':
if (fromwhere < 2) {
*misc = 1;
- break;
+ *t = '\0';
+ *len = t - buf;
+ return buf;
}
goto def;
case 'u':
Messages sorted by:
Reverse Date,
Date,
Thread,
Author