From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12757 invoked from network); 7 Apr 2021 19:22:10 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 7 Apr 2021 19:22:10 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1617823330; b=SgAqPI7BNMLbl5TcfrGw3iw/ryJdm9X0eIJuY3vTocZrwaUwk8CC2XFP3bQ5kZwzPFt/m/8Dle dwRiTd3eVPcFjUEYm8GPaZE8EAU8Ovsukr2+uHoyEVqRLNs9M7+zMlUm4ovC4F0LaSCDKJUlXs dNn2LSyTlkNj8xfmp5f8uvdZmB1dAJv8+86BQJsdJOs2sBNf/VjzHiiIGE65QpV4LJjuLqVWJd 08z5Yk0vQVFaG5llFCqCv23LBOrO2vjJjugs7QR00CTfPOh8uvt89km0GdAswEtkjtpWxPPmBr CGzxrkDGqNg7cLSE558p71Y6rkEFcODB2jAw7tlHPspOmg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (know-smtprelay-omc-5.server.virginmedia.net) smtp.remote-ip=80.0.253.69; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20200801; t=1617823330; bh=Z82VdzDehi2VWtFoG1hpks5xFuXr9Y24Pn4dpGHx10s=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:MIME-Version:Content-Type: References:In-Reply-To:Date:To:From:Subject:Message-ID:DKIM-Signature: DKIM-Signature; b=uQSxjjwXW2Jh7FxDUmB1SkL/O0CjjMpBSRyyzgUeAFzHxF9MqrGM63FdVkKqs7x05TaGHVVwYb YBtcYPWc8TP/gXUZ6Xk1fxBNINPd/6nk6l5WG2KEUQPNKugp5hrDFkKDoj6MLNWX7gTyZUFVpD D0HMBT7iiLb2CZ28A4od5wJT5Ck2R8o5dBw+0gH6zkGcYP6eubySeHieNpjAztso11EO44eKpI Tg4m9MmSM5ha6CjSp5VQ0ZRx5Cdxq4non/toDx6aYdgT3OwQgZpwwrOhPlL4YxbDj6AJrLHe7i ogdwEnLyD3+eZ6FwyB9WM/uhavX4vQfftPbYzBPkdTcj2w==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20200801; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Mime-Version:Content-Type:References:In-Reply-To:Date:To:From:Subject: Message-ID:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From :Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=nAHAftEOYrpyphcHGU9Xs9UN9g0XDKzt2Gu7BdUkRDI=; b=tf8gsNF4vFnJisb5hkBcXWrzYS ucwifqHbV+qpiLoB0UYKAEBdcbodtpNKhzwr4QnItRuO2xjZ6i3Vj+pcp6sjp9JfcuDOPqf7HohU7 7bse3U1pobZO3aoZFxAUWL/DoluYUJMoL0f8g4ta3cWSPrIyHVYWW+QUM3Xcl2i4axyp+LevQ2H0G bZ9Xj5REhuJzX1RKHiAeI4K8duMSnBafMMjyWtx7zXb+iZDm2Hngh3YocQeWNBJIDBP7zu4nalmvw +gP/+BQvBWWTwOHvUJ8Lp8KZcMcgFP8Dvcs2u0iubeWz3DpXdYB1zrjEpqbpHjP2uyK9AGybdIif8 bsKRztEg==; Received: from authenticated user by zero.zsh.org with local id 1lUDkg-000EzZ-Fg; Wed, 07 Apr 2021 19:22:10 +0000 Authentication-Results: zsh.org; iprev=pass (know-smtprelay-omc-5.server.virginmedia.net) smtp.remote-ip=80.0.253.69; dkim=pass header.d=ntlworld.com header.s=meg.feb2017 header.a=rsa-sha256; dmarc=pass header.from=ntlworld.com; arc=none Received: from know-smtprelay-omc-5.server.virginmedia.net ([80.0.253.69]:47979) by zero.zsh.org with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) id 1lUDkP-000EjE-6Q; Wed, 07 Apr 2021 19:21:53 +0000 Received: from pws-Zeus ([82.20.19.64]) by cmsmtp with ESMTPA id UDkOlKBF552czUDkOlgo8j; Wed, 07 Apr 2021 20:21:52 +0100 X-Originating-IP: [82.20.19.64] X-Authenticated-User: p.w.stephenson@ntlworld.com X-Spam: 0 X-Authority: v=2.3 cv=WpQFz+Xv c=1 sm=1 tr=0 cx=a_exe a=FYxK54AnRTbDA0SLc6W5Eg==:117 a=FYxK54AnRTbDA0SLc6W5Eg==:17 a=IkcTkHD0fZMA:10 a=zx6DCAmZuLvQir3qUcYA:9 a=QEXdDO2ut3YA:10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ntlworld.com; s=meg.feb2017; t=1617823312; bh=nAHAftEOYrpyphcHGU9Xs9UN9g0XDKzt2Gu7BdUkRDI=; h=Subject:From:To:Date:In-Reply-To:References; b=m4JEM3UTTRSKPPlLhJz4a5+d/07RdtTgsLhXhzQe4NRCyJkZXDnZCA/h5zoea4IPW EpAQt34rAKnrg9kROIfe3r6BTcMzzzibp1PVF6JDQ8hMQBuTH4UWORv5zuIP/a6VZx aUV/2uDiqgYNOeYNCUjrbM4da1y0PQ8vZkqJdscBQKcil+Ocq2i3HwDZMdcn2TSGbV WBu6fXTtOVlPwWWAXtINuD4clmHO8bsBIW5LbU0eMzCMmO7TQQWfo+qoPWdbS5VAcP iwL5BvYpuMuGzjwIO9JwaPEYVKUt2bsCcXhkwAlzCLCWgG6QoPNO19TrpIw8oqSnvj VZ/R1shMvtgkQ== Message-ID: <0b43f5848ea0b03c7204d7380754b50c7c35ce41.camel@ntlworld.com> Subject: Re: "zstyle -L" doesn't quote properly From: Peter Stephenson To: zsh-workers@zsh.org Date: Wed, 07 Apr 2021 20:21:52 +0100 In-Reply-To: References: <20210407173622.GD6316@tarpaulin.shahaf.local2> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfCHeY76gTvK6OMZDYPV1ZdEdgQQmc+h0JwXwS1UzVTuGV6pFcxPEZVkncOqwtHtGpVhupVn/Oe6dJFh253Kb8TQ/kQ+roV+Aex1L/vF4FAQsUS/qabyG bLVUTM8ykgJ9b6AVmtX97Zl7IXs62tQC9c3ZfoOrkkM3Lf/4Gg1KVgCv X-Seq: 48432 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: On Wed, 2021-04-07 at 18:24 +0000, Daniel Shahaf wrote: > Bart Schaefer wrote on Wed, 07 Apr 2021 18:12 +00:00: > > On Wed, Apr 7, 2021 at 10:36 AM Daniel Shahaf wrote: > > > > > > I'll go ahead and commit it, but whoever is working on a fix, feel free > > > to tweak/extend it as needed. > > > > I don't know how soon I'd be able to look at a fix, but there are two > > ways we could go here: One, change the quoting for -L, or two, change > > the code that defines styles to prohibit strings that need quoting in > > that syntactic position. > > I assumed we'd take the former option and wrote the test accordingly, > but if we decide on some behaviour other than what the test expects, we > can adjust it accordingly. Using the same function as everywhere else in that neighbourhood, we get zstyle -e ':completion::*:default' $'[[ $WIDGET =\n(|reverse-)menu-complete ]] && reply=(menu yes select interactive)' is that OK? If so it's just a question of updating the test. ./V05styles.ztst: starting. Test ./V05styles.ztst was expected to fail, but passed. Was testing: zstyle -L escapes the key (regression: workers/48424) ./V05styles.ztst: test XPassed. pws diff --git a/Src/Modules/zutil.c b/Src/Modules/zutil.c index cecea6d51..691ba6c2f 100644 --- a/Src/Modules/zutil.c +++ b/Src/Modules/zutil.c @@ -200,7 +200,8 @@ printstylenode(HashNode hn, int printflags) else { printf("zstyle %s", (p->eval ? "-e " : "")); quotedzputs(p->pat, stdout); - printf(" %s", s->node.nam); + putchar(' '); + quotedzputs(s->node.nam, stdout); } for (v = p->vals; *v; v++) { putchar(' ');