X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=toke.c;h=8d8ac54eebf5b65686a18c5eb8ec2a7500e36989;hb=30ef33217aeee51ee47b2433e9384b011646254a;hp=4077c6052db73724c29506fc11fd788ee841ba08;hpb=8f8cf39ca802a67cf132f9179bbf212ddb1ec64e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/toke.c b/toke.c index 4077c60..8d8ac54 100644 --- a/toke.c +++ b/toke.c @@ -2614,6 +2614,19 @@ Perl_yylex(pTHX) sv_setpvn(x, ipath, ipathend - ipath); SvSETMAGIC(x); } + else { + STRLEN blen; + STRLEN llen; + char *bstart = SvPV(CopFILESV(PL_curcop),blen); + char *lstart = SvPV(x,llen); + if (llen < blen) { + bstart += blen - llen; + if (strnEQ(bstart, lstart, llen) && bstart[-1] == '/') { + sv_setpvn(x, ipath, ipathend - ipath); + SvSETMAGIC(x); + } + } + } TAINT_NOT; /* $^X is always tainted, but that's OK */ } #endif /* ARG_ZERO_IS_SCRIPT */