diff options
author | Gisle Aas <gisle@activestate.com> | 2006-03-16 12:01:10 +0000 |
---|---|---|
committer | Gisle Aas <gisle@activestate.com> | 2006-03-16 12:01:10 +0000 |
commit | 6b845e562be40aac749b544b6d494078c54de4aa (patch) | |
tree | d5a207f6b231caa5faad6581a9fcfb1d98b1a2d0 /pp_ctl.c | |
parent | b7bef49178837907ea521cdab1ee49994bf99cf6 (diff) | |
download | perl-6b845e562be40aac749b544b6d494078c54de4aa.tar.gz |
require should ignore directories found when searching @INC not just
die as soon as it finds one. It should for instance be possible to
for require "File" to read the file "./File" even if there happens to
be a "File" directory in perl's standard library.
This fixes the RT #24404 fix in change 26373.
p4raw-id: //depot/perl@27515
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -3011,14 +3011,10 @@ S_check_type_and_open(pTHX_ const char *name, const char *mode) { Stat_t st; const int st_rc = PerlLIO_stat(name, &st); - if (st_rc < 0) { + if (st_rc < 0 || S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode)) { return NULL; } - if(S_ISDIR(st.st_mode) || S_ISBLK(st.st_mode)) { - Perl_die(aTHX_ "%s %s not allowed in require", - S_ISDIR(st.st_mode) ? "Directory" : "Block device", name); - } return PerlIO_open(name, mode); } |