From: Gurusamy Sarathy Date: Fri, 30 Jun 2000 14:47:45 +0000 (+0000) Subject: slurp mode fix in change#4736 still not quite right X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9fee9baee77e65285db6dc2a81cd0157909d1bd;p=p5sagit%2Fp5-mst-13.2.git slurp mode fix in change#4736 still not quite right p4raw-link: @4736 on //depot/perl: 684bef36d5078e84d816e42ce6a73ae4452da2d7 p4raw-id: //depot/perl@6294 --- diff --git a/pp_hot.c b/pp_hot.c index aefaf16..b066b21 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -1390,8 +1390,7 @@ Perl_do_readline(pTHX) /* delay EOF state for a snarfed empty file */ #define SNARF_EOF(gimme,rs,io,sv) \ (gimme != G_SCALAR || SvCUR(sv) \ - || !RsSNARF(rs) || (IoFLAGS(io) & IOf_NOLINE) \ - || ((IoFLAGS(io) |= IOf_NOLINE), FALSE)) + || (IoFLAGS(io) & IOf_NOLINE) || !RsSNARF(rs)) for (;;) { if (!sv_gets(sv, fp, offset) @@ -1424,6 +1423,7 @@ Perl_do_readline(pTHX) SvTAINTED_on(sv); } IoLINES(io)++; + IoFLAGS(io) |= IOf_NOLINE; SvSETMAGIC(sv); XPUSHs(sv); if (type == OP_GLOB) { diff --git a/t/io/argv.t b/t/io/argv.t index d6093f9..2595fa6 100755 --- a/t/io/argv.t +++ b/t/io/argv.t @@ -5,7 +5,7 @@ BEGIN { unshift @INC, '../lib'; } -print "1..20\n"; +print "1..21\n"; use File::Spec; @@ -107,18 +107,20 @@ print "ok 15\n"; local $/; open F, 'Io_argv1.tmp' or die; ; # set $. = 1 + print "not " if defined(); # should hit eof + print "ok 16\n"; open F, $devnull or die; print "not " unless defined(); - print "ok 16\n"; - print "not " if defined(); print "ok 17\n"; print "not " if defined(); print "ok 18\n"; + print "not " if defined(); + print "ok 19\n"; open F, $devnull or die; # restart cycle again print "not " unless defined(); - print "ok 19\n"; - print "not " if defined(); print "ok 20\n"; + print "not " if defined(); + print "ok 21\n"; close F; }