IO::Socket now sets $!, avoids eval/die (patch from Graham Barr
[p5sagit/p5-mst-13.2.git] / pp_hot.c
index 6ef302c..288bf5c 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
 #ifdef I_UNISTD
 #include <unistd.h>
 #endif
-#ifdef I_FCNTL
-#include <fcntl.h>
-#endif
-#ifdef I_SYS_FILE
-#include <sys/file.h>
-#endif
-
 
 /* Hot code. */
 
@@ -87,6 +80,8 @@ PP(pp_stringify)
     char *s;
     s = SvPV(TOPs,len);
     sv_setpvn(TARG,s,len);
+    if (SvUTF8(TOPs) && !IN_BYTE)
+       SvUTF8_on(TARG);
     SETTARG;
     RETURN;
 }
@@ -182,7 +177,16 @@ PP(pp_concat)
            }
        }
 #endif
+       if (DO_UTF8(right))
+           sv_utf8_upgrade(TARG);
        sv_catpvn(TARG,s,len);
+       if (!IN_BYTE) {
+           if (SvUTF8(right))
+               SvUTF8_on(TARG);
+       }
+       else if (!SvUTF8(right)) {
+           SvUTF8_off(TARG);
+       }
     }
     else
        sv_setpvn(TARG,s,len);  /* suppress warning */