From: Shaddy Baddah <lithium-cygwin@shaddybaddah.name>
To: cygwin@cygwin.com
Subject: Re: stat() and tilde prefix (was bad bash tab completion)
Date: Tue, 15 Jan 2013 12:33:00 -0000 [thread overview]
Message-ID: <50F54C93.9090702@shaddybaddah.name> (raw)
In-Reply-To: <20130114161307.GB8617@calimero.vinschen.de>
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
next prev parent reply other threads:[~2013-01-15 12:33 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-10 14:25 bad bash tab completion Shaddy Baddah
2012-08-10 16:54 ` Eric Blake
2013-01-14 5:21 ` stat() and tilde prefix (was bad bash tab completion) Shaddy Baddah
2013-01-14 6:17 ` Christopher Faylor
2013-01-14 12:23 ` Corinna Vinschen
2013-01-14 14:37 ` Shaddy Baddah
2013-01-14 16:13 ` Corinna Vinschen
2013-01-14 20:29 ` Stephan Mueller
2013-01-14 21:37 ` Ryan Johnson
2013-01-15 8:44 ` Corinna Vinschen
2013-01-15 12:33 ` Shaddy Baddah [this message]
2013-02-07 7:00 ` Shaddy Baddah
2013-02-07 15:32 ` Eric Blake
2013-02-07 16:10 ` Thomas Wolff
2013-02-07 16:24 ` Corinna Vinschen
2013-02-07 16:26 ` Christopher Faylor
2013-01-14 15:27 ` Christopher Faylor
2013-01-14 16:05 ` Corinna Vinschen
2013-01-14 17:00 ` Christopher Faylor
2013-01-14 22:15 ` Thomas Wolff
2013-01-15 8:56 ` Corinna Vinschen
2013-01-15 19:50 ` Andrey Repin
2013-01-15 20:03 ` Larry Hall (Cygwin)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=50F54C93.9090702@shaddybaddah.name \
--to=lithium-cygwin@shaddybaddah.name \
--cc=cygwin@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).