From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16796 invoked by alias); 10 Oct 2013 15:36:11 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31809 Received: (qmail 18396 invoked from network); 10 Oct 2013 15:35:56 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, SPF_HELO_PASS autolearn=ham version=3.3.2 X-AuditID: cbfec7f4-b7f0a6d000007b1b-11-5256c6fed2c1 Date: Thu, 10 Oct 2013 16:25:49 +0100 From: Peter Stephenson To: zsh-workers@zsh.org Subject: Re: Minor xtrace inaccuracy Message-id: <20131010162549.48c18765@pwslap01u.europe.root.pri> In-reply-to: <131010074333.ZM4312@torch.brasslantern.com> References: <131010074333.ZM4312@torch.brasslantern.com> Organization: Samsung Cambridge Solution Centre X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.0; i386-redhat-linux-gnu) MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuphluLIzCtJLcpLzFFi42I5/e/4Fd1/x8KCDJb+lbY42PyQyYHRY9XB D0wBjFFcNimpOZllqUX6dglcGbdezmUqOM9Z0fbkJ1sD4yz2LkZODgkBE4mbVx4xQ9hiEhfu rWfrYuTiEBJYyiix+sN/KGc5k8SOdU1MIFUsAqoSl+efBOtmEzCUmLppNiOILSIgLnF27XkW EFtYQEVifcNhoBoODl4Be4lDTWkgYU4BS4m2e7PYQGwhAQuJs/segy3mF9CXuPr3ExPEEfYS M6+cARvJKyAo8WPyPbCRzAJaEpu3NbFC2PISm9e8ZZ7AKDALSdksJGWzkJQtYGRexSiaWppc UJyUnmuoV5yYW1yal66XnJ+7iRESgl92MC4+ZnWIUYCDUYmHV6EkNEiINbGsuDL3EKMEB7OS CC/H5rAgId6UxMqq1KL8+KLSnNTiQ4xMHJxSDYzRklv85+/c9FThk6PQ1td/a979DoqQVohj atg8uff5VRXzDgf/AxNmbgh9l1Kfc+KOZ+Rjofb6ou8c07iuTS50k1y6zkIqv1M5LUmBmzt2 0V2vP6bTsg5fFEv2N4wylPT8eeTEvculN9qEA8w7Jz9v+fpB7u7ZSh3HbE/mGXNk0owY83zv zVRiKc5INNRiLipOBABRnR5uHwIAAA== On Thu, 10 Oct 2013 07:43:33 -0700 Bart Schaefer wrote: > In _arguments at line 398 is this: > > if [[ "$action" = \ # ]]; then > > This is printed by xtrace as: > > [[ '' == # ]] > > The quoting of the space character is lost. The stuff after the "=" is output specially to try to make the difference between special and unspecial characters different. Whitespace needs to be special. This is a bit ad hoc, but that seems to be inevitable in this case. It doesn't handle non-printing characters either, but as far as I can see quotedzputs() doesn't either. (There appear to be too many different ways of getting quoted output in the shell source.) diff --git a/Src/exec.c b/Src/exec.c index 1c44565..de1b484 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -1845,9 +1845,22 @@ quote_tokenized_output(char *str, FILE *file) case '*': case '?': case '$': + case ' ': putc('\\', file); break; + case '\t': + fputs("$'\\t'", file); + continue; + + case '\n': + fputs("$'\\n'", file); + continue; + + case '\r': + fputs("$'\\r'", file); + continue; + case '=': if (s == str) putc('\\', file); pws