This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In Perl_apply, the name of the op can be found from PL_op_name, instead
authorNicholas Clark <nick@ccl4.org>
Thu, 15 Dec 2005 16:24:21 +0000 (16:24 +0000)
committerNicholas Clark <nick@ccl4.org>
Thu, 15 Dec 2005 16:24:21 +0000 (16:24 +0000)
of using local string constants.

p4raw-id: //depot/perl@26369

doio.c

diff --git a/doio.c b/doio.c
index 69aa4c2..3445937 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -1565,7 +1565,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
 {
     register I32 val;
     register I32 tot = 0;
-    const char *what;
+    const char *const what = PL_op_name[type];
     const char *s;
     SV ** const oldmark = mark;
 
@@ -1574,11 +1574,11 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
        platforms where kill was not defined.  */
 #ifndef HAS_KILL
     if (type == OP_KILL)
-       Perl_die(aTHX_ PL_no_func, "kill");
+       Perl_die(aTHX_ PL_no_func, what);
 #endif
 #ifndef HAS_CHOWN
     if (type == OP_CHOWN)
-       Perl_die(aTHX_ PL_no_func, "chown");
+       Perl_die(aTHX_ PL_no_func, what);
 #endif
 
 
@@ -1599,7 +1599,6 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
     }
     switch (type) {
     case OP_CHMOD:
-       what = "chmod";
        APPLY_TAINT_PROPER();
        if (++mark <= sp) {
            val = SvIVx(*mark);
@@ -1638,7 +1637,6 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
        break;
 #ifdef HAS_CHOWN
     case OP_CHOWN:
-       what = "chown";
        APPLY_TAINT_PROPER();
        if (sp - mark > 2) {
             register I32 val2;
@@ -1686,7 +1684,6 @@ nothing in the core.
 */
 #ifdef HAS_KILL
     case OP_KILL:
-       what = "kill";
        APPLY_TAINT_PROPER();
        if (mark == sp)
            break;
@@ -1756,7 +1753,6 @@ nothing in the core.
        break;
 #endif
     case OP_UNLINK:
-       what = "unlink";
        APPLY_TAINT_PROPER();
        tot = sp - mark;
        while (++mark <= sp) {
@@ -1778,7 +1774,6 @@ nothing in the core.
        break;
 #if defined(HAS_UTIME) || defined(HAS_FUTIMES)
     case OP_UTIME:
-       what = "utime";
        APPLY_TAINT_PROPER();
        if (sp - mark > 2) {
 #if defined(HAS_FUTIMES)