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 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 25356 invoked from network); 23 Nov 2022 22:43:02 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 23 Nov 2022 22:43:02 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1669243382; b=gsVbrQUfpP/5UOIRjAz+fFl/2FrXQN4EL3MSnqfQIaUvWaoOHkjqOihCIIN/lB2w5DkCQQg5kP k9KAcD/9NPxTTBD2NEojOGM7M2qC/AOV4kUxhPIiWGIVdjBc+h0dEEJdBdi2MAPo6q4kaI1DQN ot3k7PexDZ5S2Zzi/LeJOtfryR/1byCLUMK1KpO4jm/1qxtkXXiXuOpR8En9XwvXL28+M6Xp5r BfVoRYKzltjIhWxB84P2IOAjkiDeA4lo2YabkNKesp4HrFXZesBHYD6WSZphr0s3cHlNWx76lX tmga0DYkpGbDpTOj/iiWaSWAEumZAFmMSyi0a4vLe/bXDg==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 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=1669243382; bh=hkh0J26Lqgb7QFePlzzo0DFXfI+e5di8jSNEfv+g1YY=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=ltXkJBwPcbjDqiBDdDjqucuDfg4Cuahmqwb1LPWyHpmyIRMhMsgkOqu3E9W2uc6b1/9I/HHtqr ju9D2yMGioRwVn5k5vGbDQ8jgxaqER7J6/mhqq0gkrVNpeBXhRy474SETWcip/hxlyoB+5oMVL Hq/7QZ4yzfIwbV5SpD/ZwAo5yt+pv2xgQ7BlmTo3cCoIby131AMcEiA+lyh7nfBjDIq/GRpc48 1UQIsLyQ/7SjugiW6dhIkkRP1ERKWVbu9IiN+QQ3WP9Pu+JtBsRcjY7/k8vqCb05tg+iw7OTo1 WPitk1VRRQ/Cb6X6ShBHrMdODeEOy4blKQmH5hm4WKbwHg==; 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-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID; bh=wdQCV43/gnPSChVRYFATB40zer8Mq4CFdZoH8VlTLWM=; b=GVoMCsOSbNhy53mhd6+HPGugH3 uQvrefDYDNDY8gyu6/rtaq2qz82VtIM8vrGA6I8e9TDD0Eq/NimXvn7fUXroM+nDoRGanGbodSSPE jLnVghU9ti4EKj/SqY6IFGcP1XKWQlXNHVlTIQQoeBhLNByUscGy+43/kWL6UCAJu1taIL8qv/Cea D12/rcC8P+S5tUjMptyCNB7P8cVB9iTnkOLkxyAvsz0bKxDB2iTGEwZCjtpTUZ82mVnWVzgpab4x3 cTDnDdB2rg683Bktk/8vPNH9Fg8RnRXWaeRDynJAXApq6TMEVq5b60GyaDk0ALy9I8UDeYvex/uDs 1pfFFIbg==; Received: by zero.zsh.org with local id 1oxySM-0005CJ-Cm; Wed, 23 Nov 2022 22:43:02 +0000 Authentication-Results: zsh.org; iprev=pass (mail-ed1-f50.google.com) smtp.remote-ip=209.85.208.50; dkim=pass header.d=brasslantern-com.20210112.gappssmtp.com header.s=20210112 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-ed1-f50.google.com ([209.85.208.50]:46651) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1oxyS9-0004sh-6S; Wed, 23 Nov 2022 22:42:50 +0000 Received: by mail-ed1-f50.google.com with SMTP id z20so222464edc.13 for ; Wed, 23 Nov 2022 14:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20210112.gappssmtp.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=wdQCV43/gnPSChVRYFATB40zer8Mq4CFdZoH8VlTLWM=; b=BxRq2iMI6NW0rn8ZHPuT7KSfnnvqp8HahGf/CHB8dYoqDUHaWX+T9t9bOJWNYAJOVU FA/ESaGXZGFUNLDjyUBIsPHPTRnprRRdFlTRk7+BvlUovSTQSNftf4cISx35JDfi80tg vdAgTEV7dhmKE2FCYQcyeFUgf2Urnt0iCB0SEf96dNpsQ5JIepbG/iEf1Urs5C+51+d4 sWeNfcB/D5L/pp1ErJ/laRZvzxjHhENnWPRSC3EAaNov++gNYdsTSRbkKabifdWKky2z tWTMFJGC0c9bzuHJOZKyWb2FtHA9tDxAcZYZ2iVXKqebTh/7DK4FaCVyyrBhUQYmzRiX fG7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=wdQCV43/gnPSChVRYFATB40zer8Mq4CFdZoH8VlTLWM=; b=5EJth4p6ZHCsx3ALMsg8w9fJBl/fEmd9Zj9YPY70hr+/Qtp70DMJ+EFlzaiQeAlojK t1kwzWYYbz97qOUTUmU2cymQXt4898yJ90AqNZ6Pw5HhbaPJXkVzKsmrXuH02mFr30FH tvLfV7JKkcNm4u1eAP1vcbn8XGm+KnVyBI1Cp8YWDHl+fWrUKSwijrACBoSD3zVvg3zZ e8vy16YV6ievOZVgHXE9zdeP4i7hNxn54U+eTpU89bS2sSxGabk/U3vjbwoYHSm/MnLY VVyJR2MY5X+wACyc7y36HPtRe9JcAr7zUk1QRW9ZSkUAPCQSn5SGRm05v98eSq1pba+0 JKKg== X-Gm-Message-State: ANoB5pnZVa5LjKF0AjdIORYBS/W9q4WsUaxDjjz/5dBq79LzVmcAazLR uAdmFPoEPjWuBONb+XOIzVL/hItl5HIHjYwj5injqfY2a21yqw== X-Google-Smtp-Source: AA0mqf5CPNSXtQve0+1x+XIJ9zexh9j2P057YD6aVFzx4ckJizVutOvAmrhrjzfzncvvyVNjqwVTY6ak98Fpzm0TOIc= X-Received: by 2002:a05:6402:4507:b0:467:205b:723d with SMTP id ez7-20020a056402450700b00467205b723dmr7547589edb.69.1669243368895; Wed, 23 Nov 2022 14:42:48 -0800 (PST) MIME-Version: 1.0 References: <45820bd7-fab6-70f5-5abb-dc444f6f1075@coldfix.de> <20221123141357.GL27622@tarpaulin.shahaf.local2> In-Reply-To: From: Bart Schaefer Date: Wed, 23 Nov 2022 14:42:37 -0800 Message-ID: Subject: Re: Path with spaces in _canonical_paths To: Daniel Shahaf Cc: zsh-workers@zsh.org, =?UTF-8?B?VGhvbWFzIEdsw6TDn2xl?= Content-Type: text/plain; charset="UTF-8" X-Seq: 51047 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 23, 2022 at 2:24 PM Daniel Shahaf wrote: > > Yes. That's why the comment says s/$origpref/$canpref/ rather than > s/$canpref/$origpref/ as the code in HEAD says. Ah, I see. The comment is explaining what the else-branch OUGHT to be accomplishing, rather than what it actually IS doing. That was not clear. > I'm not sure off the top of my head. Perhaps that patch needs an extra > ${(q)} somewhere? Or perhaps we should add -Q to the if() codepath? > What do callers expect? Callers expect it in the form from the if-branch (what compadd produces), so I think the else-branch needs some variant of (q). Thomas, can you try this? diff --git a/Completion/Unix/Type/_canonical_paths b/Completion/Unix/Type/_canonical_paths index a8fbbb524..1444bc165 100644 --- a/Completion/Unix/Type/_canonical_paths +++ b/Completion/Unix/Type/_canonical_paths @@ -42,7 +42,8 @@ _canonical_paths_add_paths () { # ### Ideally, this codepath would do what the 'if' above does, # ### but telling compadd to pretend the "word on the command line" # ### is ${"the word on the command line"/$origpref/$canpref}. - matches+=(${${(M)files:#$canpref*}/$canpref/$origpref}) + # ### The following approximates that. + matches+=(${(q)${(M)files:#$canpref*}/$canpref/$origpref}) fi for subdir in $expref?*(@); do