diff options
author | Ilya Zakharevich <ilya@math.berkeley.edu> | 1998-10-04 22:37:43 -0400 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1998-10-06 04:01:55 +0000 |
commit | 3fb323679614b9d089835e96ea80c7fcfcef7d67 (patch) | |
tree | e63387ee76dc2935ff9ce98d6527205ee4fc782b /util.c | |
parent | bab5e64b721dc227661fdeed5fa925a2a84892dd (diff) | |
download | perl-3fb323679614b9d089835e96ea80c7fcfcef7d67.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.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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) { |