From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 107078 invoked by alias); 20 Mar 2019 18:55:44 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 107062 invoked by uid 89); 20 Mar 2019 18:55:43 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=sh.exe, findutils, shexe, UD:sh.exe X-HELO: smtp-out-so.shaw.ca Received: from smtp-out-so.shaw.ca (HELO smtp-out-so.shaw.ca) (64.59.136.139) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 20 Mar 2019 18:55:42 +0000 Received: from [192.168.1.114] ([24.64.172.44]) by shaw.ca with ESMTP id 6gNIhKmyNo7SQ6gNJhIJFO; Wed, 20 Mar 2019 12:55:41 -0600 Reply-To: Brian.Inglis@SystematicSw.ab.ca Subject: Re: Corner-case bug in .exe handling? To: cygwin@cygwin.com References: <5400e6ecebaa25efa46f0011be3fc58b58c4a69c.camel@cygwin.com> <20190320092421.GR3908@calimero.vinschen.de> From: Brian Inglis Openpgp: preference=signencrypt Message-ID: <0b941a73-d901-257e-d0c9-52faaf3e138f@SystematicSw.ab.ca> Date: Wed, 20 Mar 2019 18:55:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.0 MIME-Version: 1.0 In-Reply-To: <20190320092421.GR3908@calimero.vinschen.de> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00516.txt.bz2 On 2019-03-20 03:24, Corinna Vinschen wrote: > On Mar 19 18:02, Yaakov Selkowitz wrote: >> Just came across this with 3.0.4 on both Win7 and Win10 1804: >> >> $ ls -1 /usr/bin/python2.7 >> /usr/bin/python2.7 >> $ ls -1 /usr/bin/python[2-9].[0-9] >> /usr/bin/python3.5 >> /usr/bin/python3.6 >> /usr/bin/python3.7 >> /usr/bin/python3.8 >> >> python2.7 is the actual .exe where python3.* are symlinks, but >> shouldn't 2.7 still be included in the latter? > > No, even if that looks weird. But think about what happens. ls calls > readddir. readdir returns "python2.7.exe". The matching is not done by > Cygwin, but by the shell. And python2.7.exe simply doesn't match > "python[2-9].[0-9]". > > Nothing Cygwin can do about, unless we suppress the .exe suffix in > readdir/realpath/readlink output just like we do with the ".lnk" suffix > for the old winsymlink symlink style. To also fix findutils and other glob interfaces, the filename with and without the .exe suffix would have to be returned to support both: find /bin/ -name '*sh' and find /bin/ -name 'sh.exe' unless you wanted to globally disallow finding any file with suffix .exe and at the same time restore the suffix in all cases where it is explicitly required? -- Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada This email may be disturbing to some readers as it contains too much technical detail. Reader discretion is advised. -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple