This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add the policy on compatibility and deprecation to perlpolicy.pod,
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index cd470c4..06f2d3d 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -214,7 +214,8 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
                goto say_false;
            }
 #endif /* USE_STDIO */
-           name = SvOK(*svp) ? savesvpv (*svp) : savepvs ("");
+           name = (SvOK(*svp) || SvGMAGICAL(*svp)) ?
+                       savesvpv (*svp) : savepvs ("");
            SAVEFREEPV(name);
        }
        else {
@@ -764,7 +765,7 @@ Perl_nextargv(pTHX_ register GV *gv)
                    do_close(gv,FALSE);
                    continue;
                }
-               if (*PL_inplace) {
+               if (*PL_inplace && strNE(PL_inplace, "*")) {
                    const char *star = strchr(PL_inplace, '*');
                    if (star) {
                        const char *begin = PL_inplace;
@@ -1720,9 +1721,10 @@ nothing in the core.
            while (++mark <= sp) {
                I32 proc;
                register unsigned long int __vmssts;
+               SvGETMAGIC(*mark);
                if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark)))
                    Perl_croak(aTHX_ "Can't kill a non-numeric process ID");
-               proc = SvIV(*mark);
+               proc = SvIV_nomg(*mark);
                APPLY_TAINT_PROPER();
                if (!((__vmssts = sys$delprc(&proc,0)) & 1)) {
                    tot--;
@@ -1739,6 +1741,7 @@ nothing in the core.
                    }
                }
            }
+           PERL_ASYNC_CHECK();
            break;
        }
 #endif
@@ -1746,9 +1749,10 @@ nothing in the core.
            val = -val;
            while (++mark <= sp) {
                I32 proc;
+               SvGETMAGIC(*mark);
                if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark)))
                    Perl_croak(aTHX_ "Can't kill a non-numeric process ID");
-               proc = SvIV(*mark);
+               proc = SvIV_nomg(*mark);
                APPLY_TAINT_PROPER();
 #ifdef HAS_KILLPG
                if (PerlProc_killpg(proc,val))  /* BSD */
@@ -1761,14 +1765,16 @@ nothing in the core.
        else {
            while (++mark <= sp) {
                I32 proc;
+               SvGETMAGIC(*mark);
                if (!(SvIOK(*mark) || SvNOK(*mark) || looks_like_number(*mark)))
                    Perl_croak(aTHX_ "Can't kill a non-numeric process ID");
-               proc = SvIV(*mark);
+               proc = SvIV_nomg(*mark);
                APPLY_TAINT_PROPER();
                if (PerlProc_kill(proc, val))
                    tot--;
            }
        }
+       PERL_ASYNC_CHECK();
        break;
 #endif
     case OP_UNLINK:
@@ -1918,7 +1924,11 @@ Perl_cando(pTHX_ Mode_t mode, bool effective, register const Stat_t *statbufp)
      return (mode & statbufp->st_mode) ? TRUE : FALSE;
 
 #else /* ! DOSISH */
+# ifdef __CYGWIN__
+    if (ingroup(544,effective)) {     /* member of Administrators */
+# else
     if ((effective ? PL_euid : PL_uid) == 0) { /* root is special */
+# endif
        if (mode == S_IXUSR) {
            if (statbufp->st_mode & 0111 || S_ISDIR(statbufp->st_mode))
                return TRUE;