Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
More brokenness of here-docs in `functions' output
- X-seq: zsh-workers 15639
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: More brokenness of here-docs in `functions' output
- Date: Thu, 16 Aug 2001 10:46:01 +0200
- In-reply-to: <1010816031353.ZM11237@xxxxxxxxxxxxxxxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
- References: <1010816031353.ZM11237@xxxxxxxxxxxxxxxxxxxxxxx>
Bart Schaefer wrote:
> Consider:
>
> threedocs() {
> cat <<EOF
> this is $path
> EOF
> cat <<\EOF
> this is $path
> EOF
> cat <<-EOF
> this is $path
> EOF
> }
>
> ...
>
> But look at the output of `functions threedocs':
>
> threedocs () {
> cat <<< 'this is $path'
> cat <<< 'this is $path'
> cat <<< 'this is $path'
> }
We want this to be nice, yes? So that we have two cases in text.c.
Bye
Sven
Index: Src/text.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/text.c,v
retrieving revision 1.6
diff -u -r1.6 text.c
--- Src/text.c 2001/06/25 16:07:53 1.6
+++ Src/text.c 2001/08/16 08:43:42
@@ -751,9 +751,15 @@
taddstr(fstr[f->type]);
taddchr(' ');
if (f->type == REDIR_HERESTR) {
- taddchr('\'');
- taddstr(bslashquote(f->name, NULL, 1));
- taddchr('\'');
+ if (has_token(f->name)) {
+ taddchr('\"');
+ taddstr(bslashquote(f->name, NULL, 2));
+ taddchr('\"');
+ } else {
+ taddchr('\'');
+ taddstr(bslashquote(f->name, NULL, 1));
+ taddchr('\'');
+ }
} else
taddstr(f->name);
taddchr(' ');
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author