perl5.002beta3
[perl.git] / util.c
diff --git a/util.c b/util.c
index 9ffb431..71ef5c9 100644 (file)
--- a/util.c
+++ b/util.c
@@ -858,11 +858,12 @@ mess(pat, args)
                  SvPVX(GvSV(curcop->cop_filegv)), (long)curcop->cop_line);
                s += strlen(s);
            }
-           if (GvIO(last_in_gv) &&
-               IoLINES(GvIOp(last_in_gv)) ) {
+           if (GvIO(last_in_gv) && IoLINES(GvIOp(last_in_gv))) {
+               bool line_mode = (RsSIMPLE(rs) &&
+                                 SvLEN(rs) == 1 && *SvPVX(rs) == '\n');
                (void)sprintf(s,", <%s> %s %ld",
                  last_in_gv == argvgv ? "" : GvNAME(last_in_gv),
-                 strEQ(rs,"\n") ? "line" : "chunk", 
+                 line_mode ? "line" : "chunk", 
                  (long)IoLINES(GvIOp(last_in_gv)));
                s += strlen(s);
            }