summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-10-15 23:06:25 +0000
committerLarry Wall <lwall@jpl-devvax.jpl.nasa.gov>1990-10-15 23:06:25 +0000
commit39c3038ca76b338006c640ae6da52b407dd9e654 (patch)
tree2c2e20583f6b38967167e68b93c17b5381751216 /array.c
parentb6ccd89c4e9e943419de0b1846c5d54324a5ed8a (diff)
downloadperl-39c3038ca76b338006c640ae6da52b407dd9e654.tar.gz
perl 3.0 patch #30 patch #29, continued
See patch #29.
Diffstat (limited to 'array.c')
-rw-r--r--array.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/array.c b/array.c
index 5a1fcd4e58..aff66caf87 100644
--- a/array.c
+++ b/array.c
@@ -1,4 +1,4 @@
-/* $Header: array.c,v 3.0.1.2 90/08/13 21:52:20 lwall Locked $
+/* $Header: array.c,v 3.0.1.3 90/10/15 14:56:17 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
@@ -6,6 +6,9 @@
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: array.c,v $
+ * Revision 3.0.1.3 90/10/15 14:56:17 lwall
+ * patch29: non-existent array values no longer cause core dumps
+ *
* Revision 3.0.1.2 90/08/13 21:52:20 lwall
* patch28: defined(@array) and defined(%array) didn't work right
*
@@ -38,12 +41,15 @@ int lval;
return str;
}
else
- return Nullstr;
+ return &str_undef;
}
- if (lval && !ar->ary_array[key]) {
- str = Str_new(6,0);
- (void)astore(ar,key,str);
- return str;
+ if (!ar->ary_array[key]) {
+ if (lval) {
+ str = Str_new(6,0);
+ (void)astore(ar,key,str);
+ return str;
+ }
+ return &str_undef;
}
return ar->ary_array[key];
}