summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGisle Aas <gisle@activestate.com>2006-03-16 12:01:10 +0000
committerGisle Aas <gisle@activestate.com>2006-03-16 12:01:10 +0000
commit6b845e562be40aac749b544b6d494078c54de4aa (patch)
treed5a207f6b231caa5faad6581a9fcfb1d98b1a2d0 /pp_ctl.c
parentb7bef49178837907ea521cdab1ee49994bf99cf6 (diff)
downloadperl-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.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index fcc6220678..4b0703b861 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -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);
}