[ID 20000626.007] h2xs man page contains trailing garbage
[p5sagit/p5-mst-13.2.git] / toke.c
diff --git a/toke.c b/toke.c
index 75cab91..fe14358 100644 (file)
--- a/toke.c
+++ b/toke.c
@@ -502,8 +502,14 @@ S_incline(pTHX_ char *s)
 
     ch = *t;
     *t = '\0';
-    if (t - s > 0)
+    if (t - s > 0) {
+#ifdef USE_ITHREADS
+       Safefree(CopFILE(PL_curcop));
+#else
+       SvREFCNT_dec(CopFILEGV(PL_curcop));
+#endif
        CopFILE_set(PL_curcop, s);
+    }
     *t = ch;
     CopLINE_set(PL_curcop, atoi(n)-1);
 }
@@ -981,6 +987,8 @@ S_sublex_start(pTHX)
 
            p = SvPV(sv, len);
            nsv = newSVpvn(p, len);
+            if (SvUTF8(sv))
+               SvUTF8_on(nsv);
            SvREFCNT_dec(sv);
            sv = nsv;
        } 
@@ -2946,8 +2954,7 @@ Perl_yylex(pTHX)
            PL_expect = XTERM;
        TOKEN('(');
     case ';':
-       if (CopLINE(PL_curcop) < PL_copline)
-           PL_copline = CopLINE(PL_curcop);
+       CLINE;
        tmp = *s++;
        OPERATOR(tmp);
     case ')':
@@ -6123,45 +6130,20 @@ S_scan_trans(pTHX_ char *start)
        Perl_croak(aTHX_ "Transliteration replacement not terminated");
     }
 
-    if (UTF) {
-       o = newSVOP(OP_TRANS, 0, 0);
-       utf8 = OPpTRANS_FROM_UTF|OPpTRANS_TO_UTF;
-    }
-    else {
        New(803,tbl,256,short);
        o = newPVOP(OP_TRANS, 0, (char*)tbl);
-       utf8 = 0;
-    }
 
     complement = del = squash = 0;
-    while (strchr("cdsCU", *s)) {
+    while (strchr("cds", *s)) {
        if (*s == 'c')
            complement = OPpTRANS_COMPLEMENT;
        else if (*s == 'd')
            del = OPpTRANS_DELETE;
        else if (*s == 's')
            squash = OPpTRANS_SQUASH;
-       else {
-           switch (count++) {
-           case 0:
-               if (*s == 'C')
-                   utf8 &= ~OPpTRANS_FROM_UTF;
-               else
-                   utf8 |= OPpTRANS_FROM_UTF;
-               break;
-           case 1:
-               if (*s == 'C')
-                   utf8 &= ~OPpTRANS_TO_UTF;
-               else
-                   utf8 |= OPpTRANS_TO_UTF;
-               break;
-           default: 
-               Perl_croak(aTHX_ "Too many /C and /U options");
-           }
-       }
        s++;
     }
-    o->op_private = del|squash|complement|utf8;
+    o->op_private = del|squash|complement;
 
     PL_lex_op = o;
     yylval.ival = OP_TRANS;
@@ -7025,7 +7007,9 @@ Perl_scan_num(pTHX_ char *start)
           Strtol() and Strtoul() are used above.
 
           [1] XXX Configure test needed to check for atol()
-                  (and atoll() overflow behaviour) XXX --jhi
+                  (and atoll()) overflow behaviour XXX
+
+          --jhi
 
           We need to do this the hard way.  */
 
@@ -7039,14 +7023,16 @@ Perl_scan_num(pTHX_ char *start)
           don't need to do the conversion at all. 
 
           [1] Note that this is lossy if our NVs cannot preserve our
-          UVs.  There is a metaconfig define, NV_PRESERVES_UV, but we
-          really do hope all such platforms have strtou?ll? to do a
-          lossless IV/UV conversion.
-          XXX Configure test needed to check how many UV bits
-              do our NVs preserve, really (the current test checks
-              for the roundtrip of ~0) XXX --jhi
-              Maybe do some tricks with DBL_MANT_DIG and LDBL_MANT_DIG,
-              and DBL_DIG, LDBL_DIG (this is already available as NV_DIG)?
+          UVs.  There are metaconfig defines NV_PRESERVES_UV (a boolean)
+          and NV_PRESERVES_UV_BITS (a number), but in general we really
+          do hope all such potentially lossy platforms have strtou?ll?
+          to do a lossless IV/UV conversion.
+
+          Maybe could do some tricks with DBL_DIG, LDBL_DIG and
+          DBL_MANT_DIG and LDBL_MANT_DIG (these are already available
+          as NV_DIG and NV_MANT_DIG)?
+          
+          --jhi
           */
        {
            UV uv = U_V(nv);