This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Stop truncate(word) from falling back to file name
authorFather Chrysostomos <sprout@cpan.org>
Thu, 26 Jul 2012 05:04:02 +0000 (22:04 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 26 Jul 2012 05:08:38 +0000 (22:08 -0700)
commit42409c4069deb2417b838a49810ecbce306a72b9
treea9ec16fa88220ce555c25416613a812ad50c2951
parent9a0c99494cbbb7d1253332ab4ce0581e90f707a7
Stop truncate(word) from falling back to file name

In commit 5e0adc2d66, which was a bug fix, I made the mistake of
checking the truth of the return value of gv_fetchsv, which is called
when truncate’s argument is a bareword.

This meant that truncate FOO, 0; would truncate the file named FOO if
the glob happened to have been deleted.
pp_sys.c
t/io/fs.t