From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2774 invoked by alias); 14 Apr 2012 17:27:40 -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: 30407 Received: (qmail 15243 invoked from network); 14 Apr 2012 17:27:29 -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=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <120414102712.ZM8572@torch.brasslantern.com> Date: Sat, 14 Apr 2012 10:27:12 -0700 X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-workers@zsh.org Subject: Bugs with (q-) parameter flag MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Test case: torch% x=( a '' '\b' 'c d' '$e' ) Baseline: torch% print -rl ${(q)x} a '' \\b c\ d \$e I'm not certain this first one qualifies as a bug. Is the empty string a "special character"? torch% print -rl ${(q-)x} a '\b' 'c d' '$e' Note that the empty string has disappeared. Now for some other cases. First, the expected behavior: torch% print -rl ${(qq-)x} zsh: error in flags Next: torch% print -rl ${(q-q)x} 'a' '''' '\\b' 'c\ d' '\$e' I'm not sure exactly what's going on there. It's not the same as either ${(qq)x} or ${(q)$(q-)x}} although it's close to ${(q-)${(q)x}} ... but turning empty string into '''' can't possibly be right. [ Incidentally although ${(q-)x} produces "the most readable output" for a single depth, ${(q-)${(q-)x}} is less readable than ${(q)${(q-)x}} ] torch% print -rl ${(q-qq)x} ../../zsh-4.0/Src/utils.c:4789: BUG: bad quote type in quotestring ../../zsh-4.0/Src/utils.c:4789: BUG: bad quote type in quotestring ../../zsh-4.0/Src/utils.c:4789: BUG: bad quote type in quotestring ../../zsh-4.0/Src/utils.c:4789: BUG: bad quote type in quotestring ../../zsh-4.0/Src/utils.c:4789: BUG: bad quote type in quotestring 'a' '' '\b' 'c d' '$e' That one repeats no matter how many q you use, and you can use as many of them as you want; ${(q-qqqqqq)x} is accepted. Normally more than 4 repeats of q produces "error in flags".