-char rcsid[] = "$Header: perl.c,v 4.0 91/03/20 01:37:44 lwall Locked $\nPatch level: ###\n";
+char rcsid[] = "$RCSfile: perl.c,v $$Revision: 4.0.1.4 $$Date: 91/06/10 01:23:07 $\nPatch level: ###\n";
/*
- * 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: perl.c,v $
+ * Revision 4.0.1.4 91/06/10 01:23:07 lwall
+ * patch10: perl -v printed incorrect copyright notice
+ *
+ * Revision 4.0.1.3 91/06/07 11:40:18 lwall
+ * patch4: changed old $^P to $^X
+ *
+ * Revision 4.0.1.2 91/06/07 11:26:16 lwall
+ * patch4: new copyright notice
+ * patch4: added $^P variable to control calling of perldb routines
+ * patch4: added $^F variable to specify maximum system fd, default 2
+ * patch4: debugger lost track of lines in eval
+ *
+ * Revision 4.0.1.1 91/04/11 17:49:05 lwall
+ * patch1: fixed undefined environ problem
+ *
* Revision 4.0 91/03/20 01:37:44 lwall
* 4.0 baseline.
*
#include "patchlevel.h"
#endif
+char *getenv();
+
#ifdef IAMSUID
#ifndef DOSUID
#define DOSUID
static char* moreswitches();
static char* cddir;
-#ifndef __STDC__
-extern char **environ;
-#endif /* ! __STDC__ */
static bool minus_c;
static char patchlevel[6];
static char *nrs = "\n";
{
register STR *str;
register char *s;
- char *index(), *strcpy(), *getenv();
+ char *getenv();
bool dosearch = FALSE;
#ifdef DOSUID
char *validarg = "";
(void)hadd(sigstab);
}
- magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\024\027");
+ magicalize("!#?^~=-%.+&*()<>,\\/[|`':\004\t\020\024\027\006");
userinit(); /* in case linked C routines want magical variables */
amperstab = stabent("&",allstabs);
str_set(stab_val(tmpstab),origfilename);
magicname("0", Nullch, 0);
}
- if (tmpstab = stabent("\020",allstabs))
+ if (tmpstab = stabent("\030",allstabs))
str_set(stab_val(tmpstab),origargv[0]);
if (argvstab = stabent("ARGV",allstabs)) {
argvstab->str_pok |= SP_MULTI;
}
}
+void
+savelines(array, str)
+ARRAY *array;
+STR *str;
+{
+ register char *s = str->str_ptr;
+ register char *send = str->str_ptr + str->str_cur;
+ register char *t;
+ register int line = 1;
+
+ while (s && s < send) {
+ STR *tmpstr = Str_new(85,0);
+
+ t = index(s, '\n');
+ if (t)
+ t++;
+ else
+ t = send;
+
+ str_nset(tmpstr, s, t - s);
+ astore(array, line++, tmpstr);
+ s = t;
+ }
+}
+
/* this routine is in perl.c by virtue of being sort of an alternate main() */
int
curcmd->c_filestab = fstab("(eval)");
curcmd->c_line = 1;
str_sset(linestr,str);
- str_cat(linestr,";"); /* be kind to them */
+ str_cat(linestr,";\n"); /* be kind to them */
+ if (perldb)
+ savelines(stab_xarray(curcmd->c_filestab), linestr);
}
else {
if (last_root && !in_eval) {
#endif
#endif
fputs("\n\
-Perl may be copied only under the terms of the GNU General Public License,\n\
-a copy of which can be found with the Perl 4.0 distribution kit.\n",stdout);
+Perl may be copied only under the terms of either the Artistic License or the\n\
+GNU General Public License, which may be found in the Perl 4.0 source kit.\n",stdout);
#ifdef MSDOS
usage(origargv[0]);
#endif
fprintf(stderr, "unexec of %s into %s failed!\n", perlpath, dumpname);
exit(status);
#else
+#ifdef MSDOS
+ abort(); /* nothing else to do */
+#else /* ! MSDOS */
# ifndef SIGABRT
# define SIGABRT SIGILL
# endif
# define SIGILL 6 /* blech */
# endif
kill(getpid(),SIGABRT); /* for use with undump */
+#endif /* ! MSDOS */
#endif
}