summaryrefslogtreecommitdiff
path: root/doarg.c
diff options
context:
space:
mode:
Diffstat (limited to 'doarg.c')
-rw-r--r--doarg.c28
1 files changed, 13 insertions, 15 deletions
diff --git a/doarg.c b/doarg.c
index 4a5fe24cde..045b59769b 100644
--- a/doarg.c
+++ b/doarg.c
@@ -1,4 +1,4 @@
-/* $Header: doarg.c,v 4.0 91/03/20 01:06:42 lwall Locked $
+/* $RCSfile: doarg.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:40:14 $
*
* Copyright (c) 1989, Larry Wall
*
@@ -6,6 +6,10 @@
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: doarg.c,v $
+ * Revision 4.0.1.1 91/04/11 17:40:14 lwall
+ * patch1: fixed undefined environ problem
+ * patch1: fixed debugger coredump on subroutines
+ *
* Revision 4.0 91/03/20 01:06:42 lwall
* 4.0 baseline.
*
@@ -20,10 +24,6 @@
extern unsigned char fold[];
-#ifndef __STDC__
-extern char **environ;
-#endif /* ! __STDC__ */
-
#ifdef BUGGY_MSC
#pragma function(memcmp)
#endif /* BUGGY_MSC */
@@ -831,8 +831,8 @@ register STR **sarg;
*t = '\0';
xs = str_get(*sarg);
xlen = (*sarg)->str_cur;
- if (*xs == 'S' && xs[1] == 't' && xs[2] == 'B'
- && xlen == sizeof(STBP) && strlen(xs) < xlen) {
+ if (*xs == 'S' && xs[1] == 't' && xs[2] == 'B' && xs[3] == '\0'
+ && xlen == sizeof(STBP)) {
STR *tmpstr = Str_new(24,0);
stab_fullname(tmpstr, ((STAB*)(*sarg))); /* a stab value! */
@@ -934,6 +934,12 @@ int *arglast;
}
if (!stab)
fatal("Undefined subroutine called");
+ if (!(sub = stab_sub(stab))) {
+ STR *tmpstr = arg[0].arg_ptr.arg_str;
+
+ stab_fullname(tmpstr, stab);
+ fatal("Undefined subroutine \"%s\" called",tmpstr->str_ptr);
+ }
if (arg->arg_type == O_DBSUBR && !sub->usersub) {
str = stab_val(DBsub);
saveitem(str);
@@ -942,14 +948,6 @@ int *arglast;
if (!sub)
fatal("No DBsub routine");
}
- else {
- if (!(sub = stab_sub(stab))) {
- STR *tmpstr = arg[0].arg_ptr.arg_str;
-
- stab_fullname(tmpstr, stab);
- fatal("Undefined subroutine \"%s\" called",tmpstr->str_ptr);
- }
- }
str = Str_new(15, sizeof(CSV));
str->str_state = SS_SCSV;
(void)apush(savestack,str);