perl 4.0 patch 14: patch #11, continued
[p5sagit/p5-mst-13.2.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index 539b42b..06951b5 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -1,11 +1,18 @@
-/* $Header: cmd.c,v 4.0 91/03/20 01:04:18 lwall Locked $
+/* $RCSfile: cmd.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 10:26:45 $
  *
- *    Copyright (c) 1989, Larry Wall
+ *    Copyright (c) 1991, Larry Wall
  *
- *    You may distribute under the terms of the GNU General Public License
- *    as specified in the README file that comes with the perl 3.0 kit.
+ *    You may distribute under the terms of either the GNU General Public
+ *    License or the Artistic License, as specified in the README file.
  *
  * $Log:       cmd.c,v $
+ * Revision 4.0.1.2  91/06/07  10:26:45  lwall
+ * patch4: new copyright notice
+ * patch4: made some allowances for "semi-standard" C
+ * 
+ * Revision 4.0.1.1  91/04/11  17:36:16  lwall
+ * patch1: you may now use "die" and "caller" in a signal handler
+ * 
  * Revision 4.0  91/03/20  01:04:18  lwall
  * 4.0 baseline.
  * 
@@ -24,7 +31,7 @@ void grow_dlevel();
 
 /* do longjmps() clobber register variables? */
 
-#if defined(cray) || defined(__STDC__)
+#if defined(cray) || defined(STANDARD_C)
 #define JMPCLOBBER
 #endif
 
@@ -908,7 +915,7 @@ until_loop:
 }
 
 #ifdef DEBUGGING
-#  ifndef VARARGS
+#  ifndef I_VARARGS
 /*VARARGS1*/
 deb(pat,a1,a2,a3,a4,a5,a6,a7,a8)
 char *pat;
@@ -1086,6 +1093,23 @@ HASH **hptr;
 }
 
 void
+saveaptr(aptr)
+ARRAY **aptr;
+{
+    register STR *str;
+
+    str = Str_new(17,0);
+    str->str_state = SS_SAPTR;
+    str->str_u.str_array = *aptr;      /* remember value */
+    if (str->str_ptr) {
+       Safefree(str->str_ptr);
+       str->str_len = 0;
+    }
+    str->str_ptr = (char*)aptr;                /* remember pointer */
+    (void)apush(savestack,str);
+}
+
+void
 savelist(sarg,maxsarg)
 register STR **sarg;
 int maxsarg;
@@ -1156,6 +1180,11 @@ int base;
            value->str_ptr = Nullch;
            str_free(value);
            break;
+       case SS_SAPTR:                          /* ARRAY* reference */
+           *((ARRAY**)value->str_ptr) = value->str_u.str_array;
+           value->str_ptr = Nullch;
+           str_free(value);
+           break;
        case SS_SNSTAB:
            stab = (STAB*)value->str_magic;
            value->str_magic = Nullstr;