From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1141 invoked by alias); 17 Jun 2010 16:42:37 -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: 28048 Received: (qmail 27263 invoked from network); 17 Jun 2010 16:42:25 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) 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.1 Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) MIME-Version: 1.0 In-Reply-To: <20100617125056.21e77f3e@csr.com> References: <15865.1276088859@csr.com> <20100609165429.7e19ca2c@csr.com> <20100617125056.21e77f3e@csr.com> Date: Thu, 17 Jun 2010 09:42:20 -0700 Message-ID: Subject: Re: PATCH: bug in ${(z)...} with newlines From: Bart Schaefer To: Zsh hackers list Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Thu, Jun 17, 2010 at 4:50 AM, Peter Stephenson wrote: > On Wed, 16 Jun 2010 15:13:29 -0700 > Bart Schaefer wrote: >> BTW there are uses of (z) in Functions/Zle/ that may very well be >> relying on the last ten years of behavior, including in >> match-word-context and match-words-by-style and even which-command. > > Several of those are mine, which definitely don't rely on getting somethi= ng > other than split arguments. =A0I've been assuming up to now that as long > as the words can be parsed (there are odd cases with unquoted > parentheses and the like) there should be no gotchas, and in particular > that if you've input quoted words separated by white space you should > just get the words back (hence the current thread). There are a bunch of other potential gotchas with (z) from that standpoint, such as special treatment of redirection operators. If what you really want is purely quotation parsing, it may be better to add something new rather than modify (z). Also it is helpful to have something that can distinguish a newline that would be parsed as a command separator from one that shell-syntactically is merely whitespace. That was Felix's original problem all those years ago.