From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id ebadaa7c for ; Sun, 17 Nov 2019 06:01:17 +0000 (UTC) Received: (qmail 26684 invoked by alias); 17 Nov 2019 06:01:08 -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: List-Unsubscribe: X-Seq: 44912 Received: (qmail 12551 invoked by uid 1010); 17 Nov 2019 06:01:07 -0000 X-Qmail-Scanner-Diagnostics: from brown.elm.relay.mailchannels.net by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25628. spamassassin: 3.4.2. Clear:RC:0(23.83.212.23):SA:0(-2.0/5.0):. Processed in 3.151558 secs); 17 Nov 2019 06:01:07 -0000 X-Envelope-From: wayne@opencoder.net X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at opencoder.net does not designate permitted sender hosts) X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net X-Sender-Id: dreamhost|x-authsender|dropbox@opencoder.net X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|dropbox@opencoder.net X-MailChannels-Auth-Id: dreamhost X-Bottle-Grain: 0f0ba0295a3fddb9_1573970427595_1383334153 X-MC-Loop-Signature: 1573970427595:12331017 X-MC-Ingress-Time: 1573970427595 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=opencoder.net; h= mime-version:references:in-reply-to:from:date:message-id:subject :to:content-type; s=opencoder.net; bh=8y7EYMpxiqxdv0gGZmIdvB2cQE 0=; b=EdjjGUem7OboMqZnlQHftg8RvpnWkj0ppsZBD+4Uv5/ozU6qJ5hE1JuOUu 7UZRekj7idA1263kXYQ9cLmkLkXSLzIndjjirumDJoDae19kgWAnX8O3k68v9bzC 3D6yUzOsNKcsBzFwSKHmIgrw8fUas3gBurrwNF6qUiREXv9H4= X-Gm-Message-State: APjAAAWTcqX9AgzXvcQZhIExQUnfn2yXaXMAThdKlvtPsY91sZIPQQ/T VbFyPf5hSTP0u4OoNVGPE9jqSJz2I64G7XoYKyY= X-Google-Smtp-Source: APXvYqxYLsRgBmbK2AKteHQeMyNakP1sgr8MmZHUtAykbJTpTQmWidXG9cAMsk1X6/rs+j4nRbyv8+C4qoWFmWpmSOE= X-Received: by 2002:a81:440e:: with SMTP id r14mr15052972ywa.160.1573970420071; Sat, 16 Nov 2019 22:00:20 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: X-DH-BACKEND: pdx1-sub0-mail-a92 From: Wayne Davison Date: Sat, 16 Nov 2019 22:00:07 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Non-escaped special chars from var expansion To: Zsh list Content-Type: multipart/alternative; boundary="000000000000c685740597848b0e" --000000000000c685740597848b0e Content-Type: text/plain; charset="UTF-8" I've discovered that the prior fix for the following issue is actually incomplete: On Fri, Nov 2, 2018 at 1:39 PM Wayne Davison wrote: > zsh -f > autoload -Uz compinit > compinit > zstyle ':completion:*' completer _oldlist _expand _complete _match > _ignored _files _prefix > zstyle ':completion:*:expand:*' tag-order all-expansions > bindkey -e > bindkey '\t' complete-word > mkdir 'foo; bar (baz)' > cd !:1 > cd $PWD > The fix works for this particular case because the attempted glob with "(baz)" generated an error. However, I've found 2 cases that don't generate an error where the non-glob code needs to be run, but it doesn't happen because "done_quote=1" got set. For instance, if you just run the test from one level deeper in that weird directory: mkdir foo ; cd foo ; ls $PWD That will expand to just "ls /tmp/foo;\ bar\ (baz)/foo" (the same bad quoting as before). Alternatively, if we name the dir with some valid glob suffix, it also fails to quote: mkdir '/tmp/foo (#qN)' cd !:1 ls $PWD In both failure cases I saw that $exp was an empty string, so I tweaked the "&& done_quote=1" part of the code (in _expand) to be "&& [[ "$exp" ]] && done_quote=1" and this has fixed the quoting issues I was seeing. I'm not sure if it is the right fix, though. ..wayne.. --000000000000c685740597848b0e--