diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-26 22:33:45 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-04-26 22:33:45 +0000 |
commit | 67627c52ebaff7c8807f003541daf98ec69bc00b (patch) | |
tree | 75717d675de396d0a20c1a1e3ea84075515605c2 /pp_ctl.c | |
parent | f55e507de7c660df4146d83969f0e0bed96e11d5 (diff) | |
download | perl-67627c52ebaff7c8807f003541daf98ec69bc00b.tar.gz |
Integrate changes #16199 and #16201 from macperl;
Time::Local compatibility patches, from Graham
MacPerl require() portability patches
p4raw-link: @16199 on //depot/macperl: 029195cc16ed49b9d6f99746bf12dad919bcab76
p4raw-id: //depot/perl@16204
p4raw-integrated: from //depot/macperl@16203 'copy in'
lib/Time/Local.pm (@16123..) 'merge in' pp_ctl.c (@16123..)
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 28 |
1 files changed, 17 insertions, 11 deletions
@@ -2976,6 +2976,17 @@ PP(pp_require) tryname = name; tryrsfp = doopen_pmc(name,PERL_SCRIPT_MODE); } +#ifdef MACOS_TRADITIONAL + if (!tryrsfp) { + char newname[256]; + + MacPerl_CanonDir(name, newname, 1); + if (path_is_absolute(newname)) { + tryname = newname; + tryrsfp = doopen_pmc(newname,PERL_SCRIPT_MODE); + } + } +#endif if (!tryrsfp) { AV *ar = GvAVn(PL_incgv); I32 i; @@ -3109,8 +3120,11 @@ PP(pp_require) ) { char *dir = SvPVx(dirsv, n_a); #ifdef MACOS_TRADITIONAL - char buf[256]; - Perl_sv_setpvf(aTHX_ namesv, "%s%s", MacPerl_CanonDir(dir, buf), name+(name[0] == ':')); + char buf1[256]; + char buf2[256]; + + MacPerl_CanonDir(name, buf2, 1); + Perl_sv_setpvf(aTHX_ namesv, "%s%s", MacPerl_CanonDir(dir, buf1, 0), buf2+(buf2[0] == ':')); #else #ifdef VMS char *unixdir; @@ -3124,14 +3138,6 @@ PP(pp_require) #endif TAINT_PROPER("require"); tryname = SvPVX(namesv); -#ifdef MACOS_TRADITIONAL - { - /* Convert slashes in the name part, but not the directory part, to colons */ - char * colon; - for (colon = tryname+strlen(dir); colon = strchr(colon, '/'); ) - *colon++ = ':'; - } -#endif tryrsfp = doopen_pmc(tryname, PERL_SCRIPT_MODE); if (tryrsfp) { if (tryname[0] == '.' && tryname[1] == '/') @@ -3743,7 +3749,7 @@ S_path_is_absolute(pTHX_ char *name) { if (PERL_FILE_IS_ABSOLUTE(name) #ifdef MACOS_TRADITIONAL - || (*name == ':' && name[1] != ':' && strchr(name+2, ':'))) + || (*name == ':')) #else || (*name == '.' && (name[1] == '/' || (name[1] == '.' && name[2] == '/')))) |