From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3020 invoked from network); 16 Aug 2001 08:46:21 -0000 Received: from sunsite.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 16 Aug 2001 08:46:21 -0000 Received: (qmail 2940 invoked by alias); 16 Aug 2001 08:46:15 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 15639 Received: (qmail 2929 invoked from network); 16 Aug 2001 08:46:14 -0000 From: Sven Wischnowsky MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15227.34889.492267.4370@gargle.gargle.HOWL> Date: Thu, 16 Aug 2001 10:46:01 +0200 To: zsh-workers@sunsite.dk Subject: More brokenness of here-docs in `functions' output In-Reply-To: <1010816031353.ZM11237@candle.brasslantern.com> References: <1010816031353.ZM11237@candle.brasslantern.com> X-Mailer: VM 6.92 under 21.1 (patch 3) "Acadia" XEmacs Lucid Bart Schaefer wrote: > Consider: > > threedocs() { > cat < 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@informatik.hu-berlin.de