Michael,

Thanks for your reply.  You're right -- disabling the CASE_INSENSITIVE_FILENAME 
compile-time option changes this behavior.  However, I disagree that case 
insensitivity is the correct behavior.  Cygwin is perfectly capable of 
supporting case-sensitive globbing behavior and unix tools, by default, do just 
that when run under cygwin.  For example, bash is, by default, case-sensitive 
under cygwin.  So, I submitted a bug report.

-- John

----- Original Message ----
From: Michael Schaap <[EMAIL PROTECTED]>
To: A.J.Mechelynck <[EMAIL PROTECTED]>
Cc: John Wiersba <[EMAIL PROTECTED]>; Vim mailing list <vim@vim.org>
Sent: Friday, March 16, 2007 4:21:01 PM
Subject: Re: Fw: Case-sensitive :e globbing under cygwin?

On 16-Mar-2007 20:59, A.J.Mechelynck wrote:
>
>>
>> As far as I can tell everything is set up to give case-sensitive 
>> globbing. Bash does case-sensitive globbing at the command line and 
>> in a simple script
>>
>> #!/bin/bash
>> echo file*
>>
>> Do you believe vim is shelling out to do globbing under cygwin, 
>> rather than doing globbing internally? I tried to verify that vim is 
>> calling /bin/sh by replacing /bin/sh.exe with a script /bin/sh which 
>> leaves a debugging trail. But it appears that /bin/sh is not being 
>> called for :e file* (it is called for :sh, however).
>
> I had the impression it did; but I guess I was wrong.
>
Indeed, vim does its own globbing; it looks like the main function for 
this is ExpandOne() in ex_getln.c.
It determines whether to do based on whether CASE_INSENSITIVE_FILENAME 
is #define'd. For Cygwin, this is done in os_unix.h:

#if defined(__CYGWIN__) || defined(__CYGWIN32__)
# define WIN32UNIX /* Compiling for Win32 using Unix files. */
# define BINARY_FILE_IO

# define CASE_INSENSITIVE_FILENAME
# define USE_FNAME_CASE /* Fix filename case differences. */
#endif

Like it or not, this is the proper thing to do on Cygwin, since any 
normal Windows file systems are case insensitive.
Arguably, this should be a file system property, not an operating system 
property – after all, you can mount a case-insensitive Windows file 
system under Linux. But I doubt that there is a good way to determine 
this on a file system by file system basis...

It would perhaps be an improvement if this was an option, instead of a 
compile-time decision. But there's an awful lot of "#ifdef 
CASE_INSENSITIVE_FILENAME"'s in the code, so that's probably a rather 
non-trivial change...

– Michael





 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/

Reply via email to