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,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 18147 invoked from network); 25 Jan 2021 00:53:13 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 25 Jan 2021 00:53:13 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20200801; t=1611535993; b=F8A0KEybRFt+FifrdwVpDHaURkx1kq6wbF1f53lRxduHlDBcQAGVfN1s9Aorr7QvM8l6EbdoEu To7H91cGSUjJLLQP0qGxtpVN00L46ZG5qbq7uVijEoAPge6mRuWtjDoJJBDvuE1xOUEKJtOUzQ Tl9kORd3uOI+JAfrp7Tl/eq88LUQXfDiDDY3UnR8yu9Ub1mA4vWONzK9j/g+JZj7Uts2U8MTtj vJrwjZzqDCb03/Zva6NFK4Et+V+XTSdvAxpEM4FmbQZ7P+BbZ0ZBDPSGFyHy8dJNwoiWv9cF9j 2vmhk2/prENu1oH49ltn+YK7Dj9+k+5OIa0YpyzsGLzxCA==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-oi1-f171.google.com) smtp.remote-ip=209.85.167.171; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 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-20200801; t=1611535993; bh=g4/9LebPO9PzHy9i/fbk2F3KDgp4pQylq5IV49O75Mc=; 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=QxX186wuWv/I98ziDpZj2NGgjIWxV6/maOLmJcxshUdKZFp1LFIMXQckorlYclX9dbBBwRa/in Wcs5ljLXISyleggR097kLSICniJXqvR8ugEdlI1cJ7XTI1WMKJEhWYbS8FcGlCfB77grmr/U0a gvkaGaL5Tw5X5pGkgQN5GieLM5dTl2CGxAxS12+dFDj0FIF3D8JtdiiLIWTz+iaGtl/d6mFtSS g2C70v5EHOFZp1ydAQIuiAAS2oy+B8+PbjhJ9AG4xPhYWSsJeH3HqfT8Mmot6QM9XkUGYygK19 2MfGGlZsSO+edpMjJNxvz1RO5sg17A8FouotWFpjZLPbrg==; 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-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=l/ndMbudvXnhz+yD9OawkZYE5g5Vj46dkv0jaL12NsE=; b=I8sjJfDjyDJ1C5hXzpZh3y5MmE 7108ut4kGeA0lXLfjTyF/JFqwL575HpWPz3asxMoomrZrXEXex9ux0pEungOos6O9sbwGZG99AZQK i6P3xizOiiSy8wpdOwpF7jEyQ1mckK7aAS5ww+8osg1OK2UWNyhWeam44/mfIeASYkttpMTzQ/MXI A6heADnHSeaLNujixejP3tmJyEmve15X2vmLnTitKZXs15hTxgE/jDnIkh7S7D5TPo4hVkXUta2OR pvGJMDTAi/7VOG+e5c6imdovEDnQ8wSU3WZ6pGdazZvNahVh05GRCObTSDi1HuaXLZz/f3hi4Q8m4 UooohVPQ==; Received: from authenticated user by zero.zsh.org with local id 1l3q81-000Ivn-AS; Mon, 25 Jan 2021 00:53:13 +0000 Authentication-Results: zsh.org; iprev=pass (mail-oi1-f171.google.com) smtp.remote-ip=209.85.167.171; dkim=pass header.d=brasslantern-com.20150623.gappssmtp.com header.s=20150623 header.a=rsa-sha256; dmarc=none header.from=brasslantern.com; arc=none Received: from mail-oi1-f171.google.com ([209.85.167.171]:34807) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1l3q7l-000InX-W5; Mon, 25 Jan 2021 00:52:58 +0000 Received: by mail-oi1-f171.google.com with SMTP id h192so13104184oib.1 for ; Sun, 24 Jan 2021 16:52:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=l/ndMbudvXnhz+yD9OawkZYE5g5Vj46dkv0jaL12NsE=; b=MoabbTQNgH/YeXwHBicW89HwLroTo4xIcmGFYg2GCqr4HqJOCtKCjJ9MHMKJm6Y8v6 JXrRbYUJJ90rOeRwQLrppyPl+f+i+dFYAaaO7hz7WjZdifb1EH+ObA63VURm/aVUFjtr SXEDvBlz4VGB1kFHuteAZDYQoT/fcSTAgiCOXvhy4dXX/XabcK/kb3A1hR37pBiZMv61 sx4RO4oA2J+cIWgnpa6ukoM0+KN34YZQhm/3ac2+HIZLui8rM2R8yum/6AAaW3olF3bo gBLsgs0OfM1t80OjVs3CNvExHgxElfEPQ0gMaxKCAWUPzsufUfaal9QAouJIV8YOvWTp VM6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=l/ndMbudvXnhz+yD9OawkZYE5g5Vj46dkv0jaL12NsE=; b=aGJ9m8Bagfojj7dRbK3LwybIRbPLTZDH7XJKz+pzNgpHldt4dAy2fY5WYuswQikLCd 95YbSQ/iTBXAd1mJGl8YaLO5MjtBBcjyKrQLFa3r4NQcFAsAnzoIowT9me7MwbgI56eI zQXj6dRCF2biThxlasDbx2XL3hiqtUJW9HoDr/NX2U2fSHnEVRL6xTlEtbb+T8PkLRSU bUh+buatgxj6RbX7XRpLXHrJ4IHdm9t62a/hwyFflGYQNoTo0tg4H6SaJZSAsWVvtFtB h6xlzCTHWw7xwxRIp6IJXzGsnjQDczdniOhkCNc49Eh4WqpCKXfPx+/o0i/aD4zPhUP2 9r3g== X-Gm-Message-State: AOAM533mJFh6v23Bxe+8wJml8U6LJpW8Gd+ZqqLD39eUfOLISHEc/ELD ccaYuSIZ9LPlqvyTnOxhTxGpQr0JH+yhRiZZ/rr9IZdI3YJ6Bw== X-Google-Smtp-Source: ABdhPJyRRr1byZEf8KSqwVpR+CbtCZhhAdL6ND1yi5BtezB2F2P/HvymsDRZL2C2+cD3I+aUQGT+12R+NpCSIEZ/z/Y= X-Received: by 2002:aca:de41:: with SMTP id v62mr87812oig.132.1611535976481; Sun, 24 Jan 2021 16:52:56 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Bart Schaefer Date: Sun, 24 Jan 2021 16:52:45 -0800 Message-ID: Subject: Re: NO_CASE_GLOB and unreadable directories (Episode VI: A New Hope) To: "zsh-workers@zsh.org" Cc: Devin Hussey Content-Type: text/plain; charset="UTF-8" X-Seq: 47866 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: Archived-At: No comment on this at all? Some additional remarks below. On Wed, Jan 13, 2021 at 9:57 PM Bart Schaefer wrote: > > Effectively, NO_CASE_GLOB turns the pure path > /data/data/com.termux/files/home > (to stick with the original example) into the extendedglob pattern > /(#i)data/(#i)data/(#i)com.termux/(#i)files/(#i)home > which means every component has to be compared with pattry() rather > than as a literal string. That in turn means that every parent must > be readable. There's no practical workaround for this that I can see. Without reading the parent directory, on a case-sensitive filesystem we'd have to attempt to chdir to every possible combination of upper/lower case in the pathname. > It further means that > anydir/* > becomes > (#i)anydir/(#i)* > which could be construed as incorrect, because if there are two directories > AnyDir/ > anydir/ > that pattern will return everything in both of them I think this is a real bug, but it can't be fixed without breaking the case in which the current implementation finds AnyDir/ in the absence of anydir/ (assuming the parent of AnyDir is readable). > What's wanted in Devin's case is for (#i) to apply exactly when there > are other pattern characters in the component, e.g., > (#I)anydir/(#i)* This is probably how CASEGLOB should have been implemented in the first place. Note that the documentation sort of implies this interpretation: [nocaseglob] the presence of any character which is special to filename generation will cause case-insensitive matching. For example, cvs(/) can match the directory CVS owing to the presence of the globbing flag (unless the option BARE_GLOB_QUAL is unset). There's no mention in there of what happens when the path is more than one directory deep. I see these possibilities: 1) Do nothing; Devin's case is broken by design and termux needs to come up with a solution that doesn't involve NO_CASE_GLOB. 2) Adopt (a CYGWIN-clean variant of) my patch from workers/47832, and accept that some current usage of NO_CASE_GLOB will break. 3) Add a setopt (CASE_DIRS ?) for the current behavior, and merge that with workers/47832. I haven't yet worked out how to avoid having "setopt nocasedirs" imply the effects of "setopt nocaseglob" ... perhaps name it CASE_SEARCH (?) and simply leave the implication?