Fix release date for 5.002
[p5sagit/p5-mst-13.2.git] / toke.c
diff --git a/toke.c b/toke.c
index 5f75233..e98e47c 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -761,8 +761,8 @@ Perl_parser_free(pTHX_  const yy_parser *parser)
 
     if (parser->rsfp == PerlIO_stdin())
        PerlIO_clearerr(parser->rsfp);
-    else if (parser->rsfp && parser->old_parser
-                         && parser->rsfp != parser->old_parser->rsfp)
+    else if (parser->rsfp && (!parser->old_parser ||
+               (parser->old_parser && parser->rsfp != parser->old_parser->rsfp)))
        PerlIO_close(parser->rsfp);
     SvREFCNT_dec(parser->rsfp_filters);
 
@@ -6749,6 +6749,7 @@ Perl_yylex(pTHX)
                    bool proto_after_greedy_proto = FALSE;
                    bool must_be_last = FALSE;
                    bool underscore = FALSE;
+                   bool seen_underscore = FALSE;
                    const bool warnsyntax = ckWARN(WARN_SYNTAX);
 
                    s = scan_str(s,!!PL_madskills,FALSE);
@@ -6786,7 +6787,7 @@ Perl_yylex(pTHX)
                                        greedy_proto = *p;
                                    }
                                    else if ( *p == '_' ) {
-                                       underscore = TRUE;
+                                       underscore = seen_underscore = TRUE;
                                    }
                                }
                            }
@@ -6799,7 +6800,8 @@ Perl_yylex(pTHX)
                                    greedy_proto, SVfARG(PL_subname), d);
                    if (bad_proto)
                        Perl_warner(aTHX_ packWARN(WARN_SYNTAX),
-                                   "Illegal character in prototype for %"SVf" : %s",
+                                   "Illegal character %sin prototype for %"SVf" : %s",
+                                   seen_underscore ? "after '_' " : "",
                                    SVfARG(PL_subname), d);
                    SvCUR_set(PL_lex_stuff, tmp);
                    have_proto = TRUE;