From: Hugo van der Sanden Date: Mon, 5 Aug 2002 22:26:45 +0000 (+0000) Subject: Integrate from maint-5.6/macperl via macperl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e55ac0fa2de97f387f14e72ecb12931a1e26d2c6;p=p5sagit%2Fp5-mst-13.2.git Integrate from maint-5.6/macperl via macperl Changes 17660, 17661, 17662, 17663, 17664 p4raw-id: //depot/perl@17683 p4raw-integrated: from //depot/macperl@17682 'copy in' perl.c (@17528..) --- diff --git a/perl.c b/perl.c index f7131d0..3647708 100644 --- a/perl.c +++ b/perl.c @@ -1158,7 +1158,7 @@ S_parse_body(pTHX_ char **env, XSINIT_t xsinit) #ifdef MACOS_TRADITIONAL /* ignore -e for Dev:Pseudo argument */ if (argv[1] && !strcmp(argv[1], "Dev:Pseudo")) - break; + break; #endif if (PL_euid != PL_uid || PL_egid != PL_gid) Perl_croak(aTHX_ "No -e allowed in setuid scripts"); @@ -3274,6 +3274,9 @@ STATIC void S_find_beginning(pTHX) { register char *s, *s2; +#ifdef MACOS_TRADITIONAL + int maclines = 0; +#endif /* skip forward in input to the real script? */ @@ -3285,16 +3288,16 @@ S_find_beginning(pTHX) if ((s = sv_gets(PL_linestr, PL_rsfp, 0)) == Nullch) { if (!gMacPerl_AlwaysExtract) Perl_croak(aTHX_ "No Perl script found in input\n"); - + if (PL_doextract) /* require explicit override ? */ if (!OverrideExtract(PL_origfilename)) Perl_croak(aTHX_ "User aborted script\n"); else PL_doextract = FALSE; - + /* Pater peccavi, file does not have #! */ PerlIO_rewind(PL_rsfp); - + break; } #else @@ -3317,7 +3320,18 @@ S_find_beginning(pTHX) ; } #ifdef MACOS_TRADITIONAL + /* We are always searching for the #!perl line in MacPerl, + * so if we find it, still keep the line count correct + * by counting lines we already skipped over + */ + for (; maclines > 0 ; maclines--) + PerlIO_ungetc(PL_rsfp, '\n'); + break; + + /* gMacPerl_AlwaysExtract is false in MPW tool */ + } else if (gMacPerl_AlwaysExtract) { + ++maclines; #endif } }