Skip to content

File::DosGlob only case-insensitive with metacharacters #13702

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
p5pRT opened this issue Apr 2, 2014 · 3 comments
Open

File::DosGlob only case-insensitive with metacharacters #13702

p5pRT opened this issue Apr 2, 2014 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 2, 2014

Migrated from rt.perl.org#121567 (status was 'open')

Searchable as RT121567$

@p5pRT
Copy link
Author

p5pRT commented Apr 2, 2014

From @Smylers

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.



Flags​:
  category=library
  severity=low
  module=File​::DosGlob


Site configuration information for perl 5.19.11​:

Configured by smylers at Wed Apr 2 15​:57​:20 BST 2014.

Summary of my perl5 (revision 5 version 19 subversion 11) configuration​:
  Commit id​: a04e6aa
  Platform​:
  osname=linux, osvers=3.11.0-19-generic, archname=x86_64-linux
  uname='linux fozzie 3.11.0-19-generic #33-ubuntu smp tue mar 11 18​:48​:34 utc 2014 x86_64 x86_64 x86_64 gnulinux '
  config_args='-des -Dusedevel'
  hint=previous, useposix=true, d_sigaction=define
  useithreads=undef, usemultiplicity=undef
  use64bitint=define, use64bitall=define, uselongdouble=undef
  usemymalloc=n, bincompat5005=undef
  Compiler​:
  cc='cc', ccflags ='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64',
  optimize='-O2',
  cppflags='-fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64'
  ccversion='', gccversion='4.8.1', gccosandvers=''
  intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678
  d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16
  ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
  alignbytes=8, prototype=define
  Linker and Libraries​:
  ld='cc', ldflags =' -fstack-protector -L/usr/local/lib'
  libpth=/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/4.8/include-fixed /usr/include/x86_64-linux-gnu /usr/lib
  libs=-lnsl -ldl -lm -lcrypt -lutil -lc
  perllibs=-lnsl -ldl -lm -lcrypt -lutil -lc
  libc=libc-2.17.so, so=so, useshrplib=false, libperl=libperl.a
  gnulibc_version='2.17'
  Dynamic Linking​:
  dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,-E'
  cccdlflags='-fPIC', lddlflags='-shared -O2 -L/usr/local/lib -fstack-protector'


@​INC for perl 5.19.11​:
  lib
  /usr/local/lib/perl5/site_perl/5.19.11/x86_64-linux
  /usr/local/lib/perl5/site_perl/5.19.11
  /usr/local/lib/perl5/5.19.11/x86_64-linux
  /usr/local/lib/perl5/5.19.11
  .


Environment for perl 5.19.11​:
  HOME=/home/smylers
  LANG=en_GB.utf8
  LANGUAGE=en_GB​:en
  LC_COLLATE=C
  LD_LIBRARY_PATH (unset)
  LOGDIR (unset)
  PATH=/home/smylers/bin​:/usr/local/sbin​:/usr/local/bin​:/sbin​:/bin​:/usr/sbin​:/usr/bin​:/usr/X11R6/bin​:/usr/games
  PERL_BADLANG (unset)
  PERL_CPANM_OPT=--sudo --prompt
  SHELL=/bin/bash

@p5pRT
Copy link
Author

p5pRT commented Sep 24, 2014

From @jkeenan

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)

@p5pRT
Copy link
Author

p5pRT commented Sep 24, 2014

The RT System itself - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants