From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21189 invoked by alias); 15 Jan 2013 12:33:53 -0000 Received: (qmail 21179 invoked by uid 22791); 15 Jan 2013 12:33:52 -0000 X-SWARE-Spam-Status: No, hits=2.9 required=5.0 tests=AWL,BAYES_00,BOTNET,KHOP_DNSBL_BUMP,KHOP_THREADED,RCVD_IN_MSPIKE_BL,RCVD_IN_MSPIKE_L3 X-Spam-Check-By: sourceware.org Received: from milton.worldispnetwork.com (HELO milton.worldispnetwork.com) (67.217.57.10) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jan 2013 12:33:45 +0000 Received: (qmail 13208 invoked by uid 399); 15 Jan 2013 12:33:23 -0000 Received: from c122-106-16-37.rivrw1.nsw.optusnet.com.au (HELO ?10.0.2.15?) (career@shaddybaddah.name@122.106.16.37) by milton.worldispnetwork.com with ESMTPAM; 15 Jan 2013 12:33:23 -0000 Message-ID: <50F54C93.9090702@shaddybaddah.name> Date: Tue, 15 Jan 2013 12:33:00 -0000 From: Shaddy Baddah User-Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.5) Gecko/20120624 Icedove/10.0.5 MIME-Version: 1.0 To: cygwin@cygwin.com Subject: Re: stat() and tilde prefix (was bad bash tab completion) References: <5024B4D4.6080409@shaddybaddah.name> <50F395D5.4050201@shaddybaddah.name> <20130114061747.GB16739@ednor.casa.cgf.cx> <20130114100002.GA22039@calimero.vinschen.de> <50F417F9.8040108@shaddybaddah.name> <20130114161307.GB8617@calimero.vinschen.de> In-Reply-To: <20130114161307.GB8617@calimero.vinschen.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 X-SW-Source: 2013-01/txt/msg00205.txt.bz2 Hi, On 15 Jan 2013 03:13, Corinna Vinschen wrote: >> It seems to me then that a patch to bash may be in order? I can see how >> the bash check is the right thing to do. It doesn't want the special >> tilde expansion to mask and disallow referencing of real tilde prefixed >> paths. So the stat() check is the quick win to determine that. >> >> From what I make of it, there needs to be a patch that, although can >> work generically, adds checks only required for Cygwin. And therefore >> is specific to the Cygwin package. >> >> The check would be an extension of the file_exists() function, perhaps >> called tilde_file_exists(), which determines if the tilde prefix forms >> a directory component of the path (strchr('/')?). If it does not, the >> file_exists() check is sufficient. If it does, then the check of if >> that directory exists is logically and'ed to the result of >> file_exists(). >> >> Does that sound about right? > > A check like this might be a good idea. Ultimately I would be glad to > be able to come up with more correct code in Cygwin while not getting > slower, of course. But that's wishful thinking for now. Bash, patched in the way I have described, seems to fix the tab completion issue. I will tidy up the work and publish the patch at some point soon. I may have taken a naive approach, so review comments are welcome. -- Regards, Shaddy -- 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