Add I_NETINET_TCP to help change #3391.
[p5sagit/p5-mst-13.2.git] / toke.c
diff --git a/toke.c b/toke.c
index 4803bc8..6f846dc 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -823,7 +823,7 @@ sublex_done(void)
        PL_lex_casemods = 0;
        *PL_lex_casestack = '\0';
        PL_lex_starts = 0;
-       if (SvCOMPILED(PL_lex_repl)) {
+       if (SvEVALED(PL_lex_repl)) {
            PL_lex_state = LEX_INTERPNORMAL;
            PL_lex_starts++;
            /*  we don't clear PL_lex_repl here, so that we can check later
@@ -928,10 +928,10 @@ scan_const(char *start)
     register char *d = SvPVX(sv);              /* destination for copies */
     bool dorange = FALSE;                      /* are we in a translit range? */
     I32 len;                                   /* ? */
-    I32 utf = PL_lex_inwhat == OP_TRANS
+    I32 utf = (PL_lex_inwhat == OP_TRANS && PL_sublex_info.sub_op)
        ? (PL_sublex_info.sub_op->op_private & (OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF))
        : UTF;
-    I32 thisutf = PL_lex_inwhat == OP_TRANS
+    I32 thisutf = (PL_lex_inwhat == OP_TRANS && PL_sublex_info.sub_op)
        ? (PL_sublex_info.sub_op->op_private & (PL_lex_repl ? OPpTRANS_FROM_UTF : OPpTRANS_TO_UTF))
        : UTF;
 
@@ -1487,6 +1487,7 @@ filter_del(filter_t funcp)
        return;
     /* if filter is on top of stack (usual case) just pop it off */
     if (IoDIRP(FILTER_DATA(AvFILLp(PL_rsfp_filters))) == (DIR*)funcp){
+       IoDIRP(FILTER_DATA(AvFILLp(PL_rsfp_filters))) = NULL;
        sv_free(av_pop(PL_rsfp_filters));
 
         return;
@@ -1854,7 +1855,7 @@ int yylex(PERL_YYLEX_PARAM_DECL)
            return ')';
        }
        if (PL_lex_inwhat == OP_SUBST && PL_linestr == PL_lex_repl
-           && SvCOMPILED(PL_lex_repl))
+           && SvEVALED(PL_lex_repl))
        {
            if (PL_bufptr != PL_bufend)
                croak("Bad evalled substitution pattern");
@@ -2723,6 +2724,7 @@ int yylex(PERL_YYLEX_PARAM_DECL)
        }
 
        d = s;
+       tmp = (I32)*s;
        if (PL_lex_state == LEX_NORMAL)
            s = skipspace(s);
 
@@ -2764,7 +2766,7 @@ int yylex(PERL_YYLEX_PARAM_DECL)
        }
 
        PL_expect = XOPERATOR;
-       if (PL_lex_state == LEX_NORMAL && isSPACE(*d)) {
+       if (PL_lex_state == LEX_NORMAL && isSPACE((char)tmp)) {
            bool islop = (PL_last_lop == PL_oldoldbufptr);
            if (!islop || PL_last_lop_op == OP_GREPSTART)
                PL_expect = XOPERATOR;
@@ -5362,7 +5364,7 @@ scan_subst(char *start)
        sv_catpvn(repl, "{ ", 2);
        sv_catsv(repl, PL_lex_repl);
        sv_catpvn(repl, " };", 2);
-       SvCOMPILED_on(repl);
+       SvEVALED_on(repl);
        SvREFCNT_dec(PL_lex_repl);
        PL_lex_repl = repl;
     }
@@ -5669,19 +5671,23 @@ scan_inputsymbol(char *start)
     register char *s = start;          /* current position in buffer */
     register char *d;
     register char *e;
+    char *end;
     I32 len;
 
     d = PL_tokenbuf;                   /* start of temp holding space */
     e = PL_tokenbuf + sizeof PL_tokenbuf;      /* end of temp holding space */
-    s = delimcpy(d, e, s + 1, PL_bufend, '>', &len);   /* extract until > */
+    end = strchr(s, '\n');
+    if (!end)
+       end = PL_bufend;
+    s = delimcpy(d, e, s + 1, end, '>', &len); /* extract until > */
 
     /* die if we didn't have space for the contents of the <>,
-       or if it didn't end
+       or if it didn't end, or if we see a newline
     */
 
     if (len >= sizeof PL_tokenbuf)
        croak("Excessively long <> operator");
-    if (s >= PL_bufend)
+    if (s >= end)
        croak("Unterminated <> operator");
 
     s++;