summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-06-30 14:47:45 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-06-30 14:47:45 +0000
commitb9fee9baee77e65285db6dc2a81cd0157909d1bd (patch)
tree4bd48f5bdde5ce40de1a55972864f992fdfada8a
parent7032098e3624717c340da3e1b7cc1d22959257c0 (diff)
downloadperl-b9fee9baee77e65285db6dc2a81cd0157909d1bd.tar.gz
slurp mode fix in change#4736 still not quite right
p4raw-link: @4736 on //depot/perl: 684bef36d5078e84d816e42ce6a73ae4452da2d7 p4raw-id: //depot/perl@6294
-rw-r--r--pp_hot.c4
-rwxr-xr-xt/io/argv.t12
2 files changed, 9 insertions, 7 deletions
diff --git a/pp_hot.c b/pp_hot.c
index aefaf16e4d..b066b21832 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 d6093f90ef..2595fa681c 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;
<F>; # set $. = 1
+ print "not " if defined(<F>); # should hit eof
+ print "ok 16\n";
open F, $devnull or die;
print "not " unless defined(<F>);
- print "ok 16\n";
- print "not " if defined(<F>);
print "ok 17\n";
print "not " if defined(<F>);
print "ok 18\n";
+ print "not " if defined(<F>);
+ print "ok 19\n";
open F, $devnull or die; # restart cycle again
print "not " unless defined(<F>);
- print "ok 19\n";
- print "not " if defined(<F>);
print "ok 20\n";
+ print "not " if defined(<F>);
+ print "ok 21\n";
close F;
}