This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
File::Glob: fix warnings and non-\0-ended strings
authorDavid Mitchell <davem@iabyn.com>
Wed, 13 Nov 2013 15:01:40 +0000 (15:01 +0000)
committerDavid Mitchell <davem@iabyn.com>
Wed, 13 Nov 2013 17:38:43 +0000 (17:38 +0000)
commit03e4b83dd4717161d2b8ca65f1f26bc6336676c1
tree7827bbc446b45166c00252efe8183dd3eb319257
parent46a847d35219c7d246a7d6498769055e62afb5f3
File::Glob: fix warnings and non-\0-ended strings

The lower levels of File::Glob expect null-terminated strings, while
the higher levels do s = SvPV(sv,len) and pass the len. Ease the impedance
mismatch by ensuring that s[len] is always \0. Most perl SVs will already
have that \0 anyway, so in practice this hasn't been an issue.

It also ignores the utf8-ness of the string. I've kept that as-is (too big
a can of works to open for now), but I've fixed the 'is_utf8 var not used'
warning and added an XXX comment instead.
ext/File-Glob/Glob.pm
ext/File-Glob/Glob.xs