summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>1998-10-04 22:37:43 -0400
committerGurusamy Sarathy <gsar@cpan.org>1998-10-06 04:01:55 +0000
commit017f25f12cde7f2349c4feace654ff43ec0681aa (patch)
treee63387ee76dc2935ff9ce98d6527205ee4fc782b /util.c
parent2eecd61590cdae0bfd61080e79b0196640ecd60a (diff)
downloadperl-017f25f12cde7f2349c4feace654ff43ec0681aa.tar.gz
Cumulative OS/2-related patch
Message-Id: <199810050637.CAA07781@monk.mps.ohio-state.edu> p4raw-id: //depot/perl@1930
Diffstat (limited to 'util.c')
-rw-r--r--util.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/util.c b/util.c
index fd99576b7d..20b5e251ab 100644
--- a/util.c
+++ b/util.c
@@ -2570,7 +2570,8 @@ find_script(char *scriptname, bool dosearch, char **search_ext, I32 flags)
#endif
DEBUG_p(PerlIO_printf(Perl_debug_log,
"Looking for %s\n",cur));
- if (PerlLIO_stat(cur,&PL_statbuf) >= 0) {
+ if (PerlLIO_stat(cur,&PL_statbuf) >= 0
+ && !S_ISDIR(PL_statbuf.st_mode)) {
dosearch = 0;
scriptname = cur;
#ifdef SEARCH_EXTS
@@ -2639,6 +2640,9 @@ find_script(char *scriptname, bool dosearch, char **search_ext, I32 flags)
#endif
DEBUG_p(PerlIO_printf(Perl_debug_log, "Looking for %s\n",tmpbuf));
retval = PerlLIO_stat(tmpbuf,&PL_statbuf);
+ if (S_ISDIR(PL_statbuf.st_mode)) {
+ retval = -1;
+ }
#ifdef SEARCH_EXTS
} while ( retval < 0 /* not there */
&& extidx>=0 && ext[extidx] /* try an extension? */
@@ -2661,7 +2665,9 @@ find_script(char *scriptname, bool dosearch, char **search_ext, I32 flags)
xfailed = savepv(tmpbuf);
}
#ifndef DOSISH
- if (!xfound && !seen_dot && !xfailed && (PerlLIO_stat(scriptname,&PL_statbuf) < 0))
+ if (!xfound && !seen_dot && !xfailed &&
+ (PerlLIO_stat(scriptname,&PL_statbuf) < 0
+ || S_ISDIR(PL_statbuf.st_mode)))
#endif
seen_dot = 1; /* Disable message. */
if (!xfound) {