develooper Front page | perl.perl5.porters | Postings from September 2014

[perl #121567] File::DosGlob only case-insensitive with metacharacters

From:
James E Keenan via RT
Date:
September 24, 2014 01:17
Subject:
[perl #121567] File::DosGlob only case-insensitive with metacharacters
Message ID:
rt-4.0.18-2010-1411521417-127.121567-15-0@perl.org
On Wed Apr 02 08:38:34 2014, smylers@stripey.com wrote:
> 
> This is a bug report for perl from Smylers@stripey.com,
> generated with the help of perlbug 1.40 running under perl 5.19.11.
> 
> 
> -----------------------------------------------------------------
> 
> File::DosGlob is documented as “all path components are
> case-insensitive”, but this isn't true for a pattern which doesn't
> contain any metacharacters.
> 
> For instance in a directory on a case-sensitive file system containing
> both Makefile and makefile, only an exact match is returned:
> 
> $ ./perl -Ilib -MFile::DosGlob=glob -E 'say foreach glob "makefile"'
> makefile
> 
> Yet putting an irrelevant metacharacter in there makes other parts of
> the match be case-insensitive and find both files:
> 
> $ ./perl -Ilib -MFile::DosGlob=glob -E 'say foreach glob "makefil?"'
> Makefile
> makefile
> 
> See also RT #121566, which is the equivalent bug in the File::Glob
> module.
> 
> 

Problem confirmed:

#####
[perl] 16 $ ./perl -v | head -2 | tail -1
This is perl 5, version 21, subversion 5 (v5.21.5 (v5.21.4-63-g0c7df90)) built for x86_64-linux
[perl] 17 $ ./perl -Ilib -MFile::DosGlob=glob -E 'say foreach glob "makefile"'
makefile
[perl] 18 $ ./perl -Ilib -MFile::DosGlob=glob -E 'say foreach glob "makefil?"'
makefile
Makefile
#####

-- 
James E Keenan (jkeenan@cpan.org)

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=121567



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