Win32 sitelib intuition from DLL location
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index 23b5c58..166dc07 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -889,6 +889,7 @@ register SV *sv;
     STRLEN prevlen;
     int unref = 0;
 
+    sv_setpvn(t, "", 0);
   retry:
     if (!sv) {
        sv_catpv(t, "VOID");
@@ -951,7 +952,7 @@ register SV *sv;
 
     case SVt_NULL:
        sv_catpv(t, "UNDEF");
-       return tokenbuf;
+       goto finish;
     case SVt_IV:
        sv_catpv(t, "IV");
        break;
@@ -1709,12 +1710,17 @@ STRLEN *lp;
 #endif
     }
     else if (SvIOKp(sv)) {
+       U32 oldIOK = SvIOK(sv);
        if (SvTYPE(sv) < SVt_PVIV)
            sv_upgrade(sv, SVt_PVIV);
        olderrno = errno;       /* some Xenix systems wipe out errno here */
        sv_setpvf(sv, "%Vd", SvIVX(sv));
        errno = olderrno;
        s = SvEND(sv);
+       if (oldIOK)
+           SvIOK_on(sv);
+       else
+           SvIOKp_on(sv);
     }
     else {
        if (dowarn && !localizing && !(SvFLAGS(sv) & SVs_PADTMP))
@@ -3253,7 +3259,19 @@ screamer2:
             memNE(SvPVX(sv) + SvCUR(sv) - rslen, rsptr, rslen)))
        {
            append = -1;
-           goto screamer2;
+           /*
+            * If we're reading from a TTY and we get a short read,
+            * indicating that the user hit his EOF character, we need
+            * to notice it now, because if we try to read from the TTY
+            * again, the EOF condition will disappear.
+            *
+            * The comparison of cnt to sizeof(buf) is an optimization
+            * that prevents unnecessary calls to feof().
+            *
+            * - jik 9/25/96
+            */
+           if (!(cnt < sizeof(buf) && PerlIO_eof(fp)))
+               goto screamer2;
        }
     }
 
@@ -4612,7 +4630,7 @@ sv_vcatpvfn(sv, pat, patlen, args, svargs, svmax, used_locale)
        need = (have > width ? have : width);
        gap = need - have;
 
-       SvGROW(sv, SvLEN(sv) + need);
+       SvGROW(sv, SvCUR(sv) + need + 1);
        p = SvEND(sv);
        if (esignlen && fill == '0') {
            for (i = 0; i < esignlen; i++)