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.3 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22729 invoked from network); 30 Nov 2023 00:53:25 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 30 Nov 2023 00:53:25 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1701305605; b=HvAEjGaAqskmC/onWKH4hxj8QKIF7Jc9Up1qRrz92rWHdbFZkaecfDLcOQ91vMClUZ7GaseYWd dDaQ9S2QvXXWdSyUVjWUaG/AHgjV9Fei0X+9brbaEeem5URmn5LCrk7DraGeRmc9OIlSJKXZpn s+9lX+t2Xr41t5l7vNc3RCa0lQ2lsPmoGhWq3jvAvqvfBeNpAkt5Gu3e6RMoSCJKt0+P3pa2up PKTzUiuDX4MraeS5cPawv3PR+9B7IwNbw86dwqjqBBKpMvmy825CC5peduVa9xIj19rnXEWC3n BGwMin2g8P5bku7gtWl5FrG0jp6f3MJ5H9M9R9oKgGiLBg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ej1-f54.google.com) smtp.remote-ip=209.85.218.54; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1701305605; bh=n1xtFzUfUaFg3dNEt1brSzAoLH1xmplSlFOfdsQFrck=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Transfer-Encoding:Content-Type:Cc:To:Subject: Message-ID:Date:From:In-Reply-To:References:MIME-Version:DKIM-Signature: DKIM-Signature; b=Mw8vfurQmbCPsrh0oCSISWumgZ4MnQmLiVgXSzhtNw1IpuDiSM66/HO3HnHHhsHxRtWRFGW2uY zBADyQa6Fwlh4KPTDWQdNSc4HC36W5HhXez5kEdjaW3xabEtn1mLnT5n2WzP1r4WQn655cU8BG 0FvvqFdnR3weGrLBPRbVadTdMOqdROkDn8tcCVAYmIBLdwY6u7KMLdyAsjpJT7XXME7JCP5cUE 2Npuk2tviXO3CRUFoNIzsv2dMppnqZVyUnxr0oehVMq1vKramE+rfwHbmf6fSH+sV1GpjXWs+d zebtifBOvoXNSn+AzI3lG/q/lMvoM4Boj9azW1UH1LHoAA==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Transfer-Encoding: Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=XVC4QT+DFE010G3+7eKJMfmFEB5bJS/hepXyOhD65ws=; b=LS6V6j3Fx4feH7cJG2vbr7F5hk ybMAU8EnLv3DhZYXYgdUBU+23/kVvVgR2srpmVVIxiuPnaLM0LJxl7PhyAaZjBomXQf+gpnRDlARS 4KUguNeavoKVilLvydBOn3VDNRhBZQm6KG2wL7g/2ArD4tNciKBCxmPumGGIg5gSg+ErrUDM8XC6e 5w0ubayTlZ5uRr4by8gZUZp2qulCDlC4YFsFAndk/hLyhMpK1N07CIe46yHgtnJanq9beQ9N6NUch snrp8qFghdHVGCj6cBMi8TIr02xfZoYqVnxFVECsHFSU0LiIJ9yAPD+AL3LFwmiIaBRAIUKfxsmuH M35EZGqg==; Received: by zero.zsh.org with local id 1r8VIz-000NkN-3v; Thu, 30 Nov 2023 00:53:25 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ej1-f54.google.com) smtp.remote-ip=209.85.218.54; dkim=pass header.d=brasslantern-com.20230601.gappssmtp.com header.s=20230601 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ej1-f54.google.com ([209.85.218.54]:56792) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1r8VIN-000NRZ-SQ; Thu, 30 Nov 2023 00:52:49 +0000 Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a0029289b1bso45900066b.1 for ; Wed, 29 Nov 2023 16:52:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20230601.gappssmtp.com; s=20230601; t=1701305567; x=1701910367; darn=zsh.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=XVC4QT+DFE010G3+7eKJMfmFEB5bJS/hepXyOhD65ws=; b=qOf+GaEiXI3F5LzWFTAsIInLHZFm7e3N8603ninvJJbjZ7IWollJBHR9Iq3bFOUYg3 63nx+nAyFIGYqEccZweVGXZogBsBGHW5asmAenyNeo8gjLTQ8DQsjQYxE9ZiI2zWRA9P 896uMDEC9yKuwsmZIadwWlQX5uDxjpSaV5qxCyLMIR9jbOh3jGQ1vxKwKTNU5/SbwSsq wIFT0mXIxkBKaKNz6q/N8/hwclTXCrJLBQSoXHKJqGjnrMfflxsTPWx85utVcLEN9SH1 +zvLqgC2Ko/GIBo8Lg0r+xXIdvn/Rc7pF4yyto4QIUwBJxb+nk+XJSqQ+XZRHbRyd5uc aM0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701305567; x=1701910367; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XVC4QT+DFE010G3+7eKJMfmFEB5bJS/hepXyOhD65ws=; b=eNzrdzCyHAzBedXY62aVsHCHgbIjAljuIJSLWepAhotq1bLCJhrdC0Hv2weDjtI1F+ f93yIEsgLpa638T4CsXBq5Ar+i6HH6+d6T0TwmpYl1fBUudyB57aiCK1cdVhbTJJvNQl nAwtJ3aENVGgpukx5RiOwW9WqV56v3IwbAG7YECJCZAiWhNsDgWVbmcih8pA2/NU1Qyb R+AN/Kvlj3TnN4sfZH7jC+GAEuBaOOwW/nvVBAewkyDkO6iBDq3rGSGP5p8VHOjrn/Wc 98FLWT98aA6iztTebFmm3KnuvRgjnH6lwSZz+oY1WvvU5fi0yq5UbmuYQaYUuI+RlmB/ zI4Q== X-Gm-Message-State: AOJu0YzT4spISws2z0kcRab3AKK1iwN4VK6vaoD8daDXl2wNgs6alRtf 26wOoks+7jDn2kAT9VFhNXJ9x+y+MGpzkVoczOB5EA== X-Google-Smtp-Source: AGHT+IEuuIV/4MQmfTcV7LN1hdG3h3Ns+eFrO3nQw/atT+fxS0vMr0W3BdC+feKvgFlLSYwh/iqSKfmfLwjimEyfYcU= X-Received: by 2002:a17:906:bc42:b0:9be:b41d:4f7e with SMTP id s2-20020a170906bc4200b009beb41d4f7emr11993714ejv.17.1701305567268; Wed, 29 Nov 2023 16:52:47 -0800 (PST) MIME-Version: 1.0 References: <207461559.9336309.1701221332233.ref@mail.yahoo.com> <207461559.9336309.1701221332233@mail.yahoo.com> <1085378061.9900970.1701303310889@mail.yahoo.com> In-Reply-To: <1085378061.9900970.1701303310889@mail.yahoo.com> From: Bart Schaefer Date: Wed, 29 Nov 2023 16:52:36 -0800 Message-ID: Subject: Re: PATCH: Improve quote handling in _ant completion To: German Riano Cc: Mikael Magnusson , "zsh-workers@zsh.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Seq: 52341 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, Nov 29, 2023 at 4:15=E2=80=AFPM German Riano wro= te: > > Even just using 'print -qn' works. Er, what? % print -qn foo print: bad option: -q Do you mean "printf %q ..." ? > Questions: > 1. Is "${(qq):-$ln} equivalent to "${(qq)ln} ? Yes. I left it with the ":-" because in the other case there's a trailing space inside the right brace (ultimately, inside the right single-quote) and I thought one might be needed here as well. > 2. Does the read command needs '-r' ? I don't think so, the backslashes will already have been removed by "eval" ... but perhaps if there's actually a literal backslash in the target name, yes. > 3. Does using eval creates the risk of arbitrary execution of code? It does as written before any of these patches, because a target name could embed matched pairs of single quotes and $(...) in such a way that the eval would run the substitution. I think fixing the inner-single-quoting via (qq) removes that possibility, but it would still be better not to need the eval.