extra code in pp_concat, Take 2
[p5sagit/p5-mst-13.2.git] / pp_sys.c
index 5c1cc64..300ea6d 100644 (file)
--- a/pp_sys.c
+++ b/pp_sys.c
 #   include <shadow.h>
 #endif
 
-#ifdef HAS_SYSCALL
-#ifdef __cplusplus
-extern "C" int syscall(unsigned long,...);
-#endif
-#endif
-
 #ifdef I_SYS_WAIT
 # include <sys/wait.h>
 #endif
@@ -367,8 +361,7 @@ PP(pp_backtick)
                }
                XPUSHs(sv_2mortal(sv));
                if (SvLEN(sv) - SvCUR(sv) > 20) {
-                   SvLEN_set(sv, SvCUR(sv)+1);
-                   Renew(SvPVX(sv), SvLEN(sv), char);
+                   SvPV_shrink_to_cur(sv);
                }
                SvTAINTED_on(sv);
            }
@@ -1135,7 +1128,10 @@ PP(pp_sselect)
        }
     }
 
-    PUSHi(nfound);
+    if (nfound == -1)
+       PUSHs(&PL_sv_undef);
+    else
+       PUSHi(nfound);
     if (GIMME == G_ARRAY && tbuf) {
        value = (NV)(timebuf.tv_sec) +
                (NV)(timebuf.tv_usec) / 1000000.0;
@@ -1699,7 +1695,7 @@ PP(pp_sysread)
 
        read_target = sv_newmortal();
        SvUPGRADE(read_target, SVt_PV);
-       buffer = SvGROW(read_target, length + 1);
+       buffer = SvGROW(read_target, (STRLEN)(length + 1));
     }
 
     if (PL_op->op_type == OP_SYSREAD) {