From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14179 invoked by alias); 29 Aug 2016 02:01:39 -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: 39115 Received: (qmail 13398 invoked from network); 29 Aug 2016 02:01:38 -0000 X-Qmail-Scanner-Diagnostics: from mail-pf0-f193.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(209.85.192.193):SA:0(0.0/5.0):. Processed in 0.772526 secs); 29 Aug 2016 02:01:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: schaefer@brasslantern.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at brasslantern.com does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:in-reply-to:comments:references:to:subject :mime-version; bh=d9jiAlaB89mOyTkQMmFckbSdI2f0uAUTuDywSZQMoog=; b=kUXD46+2GWoRlIJI5TWlOTYXbjru91JsaF9f+nJkEBEKqT8myXF5vp5JzKAq8l7iJI lsf0CN2TCmTj3UMSa8wsCcOdjCueJjllBFqcTunoKsQLoSDSFzEXhGbXNtNy0LNxxPMv rtPRbq0NQQLDpeu7AI58+dBcjn94vs3anLpkFbj9LAnoGSTwXCkDS0zEUgWAlAbtyWHp WVsUT9gN5EJYrLPrRmDFJYuN2uFYw2rObWJ4mbrAf6nxiIJUGvDEh3Hq+Mo3se90CAd4 m9r76SvlViAjk1mfrAwyqMcZftHz6sXTPC1TruOa6zKcd5JjiQCd0pWtyQW1MggABMWU 2RjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:message-id:date:in-reply-to:comments :references:to:subject:mime-version; bh=d9jiAlaB89mOyTkQMmFckbSdI2f0uAUTuDywSZQMoog=; b=J3BI0EjIbQY8SJidcl0/sXh6QZU431LTi2CESteQpNxjwsb7tpz+jK02prIsDHoleF 1EXlPcEZLW3/7A+3Z8LRa/Id+y8zstdCrlDz97T0mXgw8AfAiGaV/6SIbKnH+bGsKJfj Y90pgI57efoZMgUs0e1jRZ6BAF+GF+6PQ6jRBoj4EvKOg9Dr/VkbzA54Ib4ky2jiQrkc JuHdW7koq2AY0+DT/vo9a1UuAqGLzPrhvtrbbTLDYINXPQaoj50Xti8l8vqIZ4lpEaCP qO15Qd3mxEk0FWoEE0mZF1elFqMb0SmizGyEoZFnFIDONOxP3nK8ckeAJp/0WViDSTsX 6IUQ== X-Gm-Message-State: AE9vXwNLbAsfSMkiyaPhKco1EWmUUxeugbQPyiFU779/QRM8+e6aSlMB+WSzydFqHZWS8w== X-Received: by 10.98.58.73 with SMTP id h70mr27759572pfa.125.1472436090714; Sun, 28 Aug 2016 19:01:30 -0700 (PDT) From: Bart Schaefer Message-Id: <160828190158.ZM23517@torch.brasslantern.com> Date: Sun, 28 Aug 2016 19:01:58 -0700 In-Reply-To: <8760qkqz8l.fsf@ft.bewatermyfriend.org> Comments: In reply to Frank Terbeck "Re: Broken specialsed file completion" (Aug 29, 12:56am) References: <20160828222112.0433a930@ntlworld.com> <8760qkqz8l.fsf@ft.bewatermyfriend.org> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: Zsh hackers list Subject: Re: Broken specialsed file completion MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 29, 12:56am, Frank Terbeck wrote: } } > For some reason the following, which has worked fine for many years, has } > stopped working. } > } > Instead of completing most recently modified files, it reports } > } > _path_files:compfiles:466: too few arguments } } I had a bit of time on my hands, so I bisected this down to this commit: } } 39019 (cf. PWS 39013): fix SHWORDSPLIT regression introduced by workers/29313 The difference is this expression (_path_files line 59): sopt="-${(@j::M)${(@)tmp1#-}#?}" Previously this would result in sopt='-' but now it appears to yield sopt='' -- which doesn't seem to make any sense, because the "-" is outside of the parameter expansion. However, it's affected by the setting of rcexpandparam in $_comp_options. The expansion of ${(@j::M)${(@)tmp1#-}#?} used to result in a scalar empty string, but now it results in an empty array, and rcexpandparam discards the "-" because it has no array element with which to pair. What's happened here is that given (@j::), the @ is forcing an array, where previously the j would force a string. I'm still not entirely sure what it should mean to use @ and j in the same expansion, but clearly it's wrong for the j to be ignored. Does the D04 test case below look correct to everyone? diff --git a/Src/subst.c b/Src/subst.c index 15eb59b..4641b4b 100644 --- a/Src/subst.c +++ b/Src/subst.c @@ -3458,7 +3458,8 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, if (ssub || spbreak || spsep || sep) { int force_split = !ssub && (spbreak || spsep); if (isarr) { - if (nojoin == 0) { + /* sep non-null here means F or j flag, force join */ + if (nojoin == 0 || sep) { val = sepjoin(aval, sep, 1); isarr = 0; ms_flags = 0; @@ -3467,7 +3468,7 @@ paramsubst(LinkList l, LinkNode n, char **str, int qt, int pf_flags, * forced joining as previously determined, or * join on what we later use to forcibly split */ - val = sepjoin(aval, (nojoin == 1 ? sep : spsep), 1); + val = sepjoin(aval, (nojoin == 1 ? NULL : spsep), 1); isarr = 0; } } diff --git a/Test/D04parameter.ztst b/Test/D04parameter.ztst index 37166fa..0630079 100644 --- a/Test/D04parameter.ztst +++ b/Test/D04parameter.ztst @@ -1986,3 +1986,12 @@ >one >two-bucklemy >shoe + + ( + set -- "one two" "bucklemy shoe" + IFS= + setopt shwordsplit rcexpandparam + print -l "X${(@j.-.)*}" + ) +0:Use of @ does not prevent forced join with j +>Xone two-bucklemy shoe