diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-01-25 11:01:49 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-01-25 11:01:49 +0000 |
commit | eb1102fcca2230364ceadea29bd8e87ee51b15fa (patch) | |
tree | bbe40957b80489b669b86133adb740b5d811cf73 /pp_ctl.c | |
parent | 3ed9f8f7de3dfc6ca29c4acc02b797c9dd51d971 (diff) | |
download | perl-eb1102fcca2230364ceadea29bd8e87ee51b15fa.tar.gz |
Integrate mainline
All but ../lib/Unicode/UCD.t pass.
p4raw-id: //depot/perlio@14412
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 52 |
1 files changed, 30 insertions, 22 deletions
@@ -1,6 +1,6 @@ /* pp_ctl.c * - * Copyright (c) 1991-2001, Larry Wall + * Copyright (c) 1991-2002, Larry Wall * * You may distribute under the terms of either the GNU General Public * License or the Artistic License, as specified in the README file. @@ -2927,30 +2927,11 @@ PP(pp_require) /* prepare to compile file */ -#ifdef MACOS_TRADITIONAL - if (PERL_FILE_IS_ABSOLUTE(name) - || (*name == ':' && name[1] != ':' && strchr(name+2, ':'))) - { + if (path_is_absolute(name)) { tryname = name; tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE); - /* We consider paths of the form :a:b ambiguous and interpret them first - as global then as local - */ - if (!tryrsfp && *name == ':' && name[1] != ':' && strchr(name+2, ':')) - goto trylocal; } - else -trylocal: { -#else - if (PERL_FILE_IS_ABSOLUTE(name) - || (*name == '.' && (name[1] == '/' || - (name[1] == '.' && name[2] == '/')))) - { - tryname = name; - tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE); - } - else { -#endif + if (!tryrsfp) { AV *ar = GvAVn(PL_incgv); I32 i; #ifdef VMS @@ -3073,6 +3054,14 @@ trylocal: { } } else { + if (!path_is_absolute(name) +#ifdef MACOS_TRADITIONAL + /* We consider paths of the form :a:b ambiguous and interpret them first + as global then as local + */ + || (*name == ':' && name[1] != ':' && strchr(name+2, ':')) +#endif + ) { char *dir = SvPVx(dirsv, n_a); #ifdef MACOS_TRADITIONAL char buf[256]; @@ -3104,6 +3093,7 @@ trylocal: { tryname += 2; break; } + } } } } @@ -3700,3 +3690,21 @@ run_user_filter(pTHX_ int idx, SV *buf_sv, int maxlen) return len; } +/* perhaps someone can come up with a better name for + this? it is not really "absolute", per se ... */ +static bool +S_path_is_absolute(pTHX_ char *name) +{ + if (PERL_FILE_IS_ABSOLUTE(name) +#ifdef MACOS_TRADITIONAL + || (*name == ':' && name[1] != ':' && strchr(name+2, ':'))) +#else + || (*name == '.' && (name[1] == '/' || + (name[1] == '.' && name[2] == '/')))) +#endif + { + return TRUE; + } + else + return FALSE; +} |