Don't double implicit loop if perl is invoked with -pn
Perl 5 Porters [Tue, 19 Mar 1996 00:25:46 +0000 (00:25 +0000)]
toke.c

diff --git a/toke.c b/toke.c
index 7bb61c9..5a43c09 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -1485,8 +1485,9 @@ yylex()
                    if (*d++ == '-') {
                        while (d = moreswitches(d)) ;
                        if (perldb && !oldpdb ||
-                           minus_n && !oldn ||
-                           minus_p && !oldp)
+                           ( minus_n || minus_p ) && !(oldn || oldp) )
+                             /* if we have already added "LINE: while (<>) {",
+                                we must not do it again */
                        {
                            sv_setpv(linestr, "");
                            oldoldbufptr = oldbufptr = s = SvPVX(linestr);