develooper Front page | perl.perl5.porters | Postings from June 2008

Re: [perl #55162] Re: File::Spec Cygwin/Win32 case_tolerant improvement

Thread Next
From:
Reini Urban
Date:
June 2, 2008 14:07
Subject:
Re: [perl #55162] Re: File::Spec Cygwin/Win32 case_tolerant improvement
Message ID:
484461ED.3010905@x-ray.at
Jan Dubois schrieb:
> On Mon, 02 Jun 2008, Reini Urban via RT wrote:
>> Oops, I did it again.
> My eyes! The goggles do nothing!
> 
>> Attached is the fixed 511 - blead patch without
>> syntax error.
> 
> I don't like the hard-coded "C:" in your patch.  Assuming you want to
> specify the drive where Windows itself was installed, you should
> write something like this:

No.

case_tolerant is normally used platform-specific only, and not 
drive-specific. So the 99% usecase is without any argument,
hence just C: (first drive) and not SYSTEMDRIVE // WINDIR

Only if someone really wants to check a drive, the hairy code is used, 
with C: being the default.

>   drive ||= $ENV{SYSTEMDRIVE} || substr($ENV{WINDIR}, 0, 2);
> 
> The reference to WINDIR is only for Win9X, which doesn't have
> SYSTEMDRIVE. You could also probably just use WINDIR everywhere.
> 
> Cheers,
> -Jan
> 
> PS: If you do another patch to the file, could you also do
>     s/MsWin32/MSWin32/g as well?  Thanks!

Oops, did I use the ugly "MsWin32". Bad.

Attached is another take, which fixes MsWin32 from last year and some 
more bad wordings.
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About