--- /dev/null
+optimize='-g'
+d_volatile=undef
+d_castneg=undef
+cc=cc
+libpth="/usr/lib/cmplrs/cc $libpth"
+groupstype=int
--- /dev/null
+ccflags="$ccflags -W2,-Sl,2000"
+d_mkdir=$undef
--- /dev/null
+: Just disable defaulting to -fpcc-struct-return, since gcc is native compiler.
+ccflags="$ccflags "
--- /dev/null
+ccflags="$ccflags -D_BSD"
--- /dev/null
+yacc='/usr/bin/yacc -m25000'
+i_dirent=undef
--- /dev/null
+yacc='/usr/bin/yacc -m25000'
+i_dirent=undef
--- /dev/null
+yacc='/usr/bin/yacc -m25000'
+libswanted=`echo $libswanted | sed 's/ x / /'`
--- /dev/null
+yacc='/usr/bin/yacc -m25000'
+libswanted=`echo $libswanted | sed 's/ x / /'`
--- /dev/null
+yacc='/usr/bin/yacc -Sm11000'
+libswanted=`echo $libswanted | sed 's/ x / /'`
+i_varargs=undef
--- /dev/null
+optimize='-O0'
+usemymalloc='y'
+mallocsrc='malloc.c'
+mallocobj='malloc.o'
+ccflags="$ccflags -Uf_next"
+d_voidsig=define
+d_vfork=undef
--- /dev/null
+usemymalloc=n
+mallocsrc=''
+mallocobj=''
--- /dev/null
+usemymalloc=n
+mallocsrc=''
+mallocobj=''
--- /dev/null
+echo ': work around botch in SunOS 4.0.1 and 4.0.2' >>../perl.h
+echo '#ifndef fputs' >>../perl.h
+echo '#define fputs(str,fp) fprintf(fp,"%s",str)' >>../perl.h
+echo '#endif' >>../perl.h
--- /dev/null
+echo ': work around botch in SunOS 4.0.1 and 4.0.2' >>../perl.h
+echo '#ifndef fputs' >>../perl.h
+echo '#define fputs(str,fp) fprintf(fp,"%s",str)' >>../perl.h
+echo '#endif' >>../perl.h
--- /dev/null
+ccflags="$ccflags -DLANGUAGE_C"
+d_waitpid=$undef
--- /dev/null
+ccflags="$ccflags -DLANGUAGE_C -Olimit 2900"
--- /dev/null
+ccflags="$ccflags -DCRIPPLED_CC -g"
+d_lstat=$undef
-/* $Header: malloc.c,v 4.0 91/03/20 01:28:52 lwall Locked $
+/* $RCSfile: malloc.c,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:48:31 $
*
* $Log: malloc.c,v $
+ * Revision 4.0.1.1 91/04/11 17:48:31 lwall
+ * patch1: Configure now figures out malloc ptr type
+ *
* Revision 4.0 91/03/20 01:28:52 lwall
* 4.0 baseline.
*
#define ASSERT(p)
#endif
-char *
+MALLOCPTRTYPE *
malloc(nbytes)
register unsigned nbytes;
{
*/
int reall_srchlen = 4; /* 4 should be plenty, -1 =>'s whole list */
-char *
+MALLOCPTRTYPE *
realloc(cp, nbytes)
char *cp;
unsigned nbytes;
-#define PATCHLEVEL 1
+#define PATCHLEVEL 2
-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.1 $$Date: 91/04/11 17:49:05 $\nPatch level: ###\n";
/*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: perl.c,v $
+ * 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.
*
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";
-/* $Header: perl.h,v 4.0 91/03/20 01:37:56 lwall Locked $
+/* $RCSfile: perl.h,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:49:51 $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: perl.h,v $
+ * Revision 4.0.1.1 91/04/11 17:49:51 lwall
+ * patch1: hopefully straightened out some of the Xenix mess
+ *
* Revision 4.0 91/03/20 01:37:56 lwall
* 4.0 baseline.
*
*/
-#define VOIDUSED 1
+#define VOIDWANT 1
#include "config.h"
#ifdef MSDOS
#endif
#endif
+#ifndef strerror
#ifdef HAS_STRERROR
char *strerror();
#else
extern char *sys_errlist[];
#define strerror(e) ((e) < 0 || (e) >= sys_nerr ? "(unknown)" : sys_errlist[e])
#endif
+#endif
#ifdef I_SYSIOCTL
#ifndef _IOCTL_
#define ntohi ntohl
#endif
-#if defined(I_DIRENT) && !defined(M_XENIX)
+#if defined(I_DIRENT)
# include <dirent.h>
# define DIRENT dirent
#else
EXT char **origargv;
EXT int origargc;
EXT char **origenviron;
+extern char **environ;
+
EXT line_t subline INIT(0);
EXT STR *subname INIT(Nullstr);
EXT int arybase INIT(0);
.rn '' }`
-''' $Header: perl.man,v 4.0 91/03/20 01:38:08 lwall Locked $
+''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
'''
''' $Log: perl.man,v $
+''' Revision 4.0.1.1 91/04/11 17:50:44 lwall
+''' patch1: fixed some typos
+'''
''' Revision 4.0 91/03/20 01:38:08 lwall
''' 4.0 baseline.
'''
print "\et" x ($tab/8), \' \' x ($tab%8); # tab over
- @ones = (1) x ; # an array of 80 1's
+ @ones = (1) x 80; # an array of 80 1's
@ones = (5) x @ones; # set all elements to 5
.fi
.fi
''' Beginning of part 2
-''' $Header: perl.man,v 4.0 91/03/20 01:38:08 lwall Locked $
+''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
'''
''' $Log: perl.man,v $
+''' Revision 4.0.1.1 91/04/11 17:50:44 lwall
+''' patch1: fixed some typos
+'''
''' Revision 4.0 91/03/20 01:38:08 lwall
''' 4.0 baseline.
'''
size of the message type. Returns true if successful, or false if
there is an error.
''' Beginning of part 3
-''' $Header: perl.man,v 4.0 91/03/20 01:38:08 lwall Locked $
+''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
'''
''' $Log: perl.man,v $
+''' Revision 4.0.1.1 91/04/11 17:50:44 lwall
+''' patch1: fixed some typos
+'''
''' Revision 4.0 91/03/20 01:38:08 lwall
''' 4.0 baseline.
'''
.Sp
Note that write is NOT the opposite of read.
''' Beginning of part 4
-''' $Header: perl.man,v 4.0 91/03/20 01:38:08 lwall Locked $
+''' $RCSfile: perl.man,v $$Revision: 4.0.1.1 $$Date: 91/04/11 17:50:44 $
'''
''' $Log: perl.man,v $
+''' Revision 4.0.1.1 91/04/11 17:50:44 lwall
+''' patch1: fixed some typos
+'''
''' Revision 4.0 91/03/20 01:38:08 lwall
''' 4.0 baseline.
'''
If your stdio requires an seek or eof between reads and writes on a particular
stream, so does
.IR perl .
+(This doesn't apply to sysread() and syswrite().)
.PP
While none of the built-in data types have any arbitrary size limits (apart
from memory size), there are still a few arbitrary limits:
#!/bin/sh
+# Hacks to make it work with Interactive's SysVr3 Version 2.2
+# doughera@lafvax.lafayette.edu (Andy Dougherty) 3/23/91
+
input=$1
output=$2
tmp=/tmp/f$$
+plan="unknown"
+
+# Test for BSD 4.3 version.
egrep 'YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];
-short[ ]*yys\[ *YYMAXDEPTH *\] *;
+short[ ]*yys\[ *YYMAXDEPTH *\] *;
yyps *= *&yys\[ *-1 *\];
yypv *= *&yyv\[ *-1 *\];
if *\( *\+\+yyps *> *&yys\[ *YYMAXDEPTH *\] *\)' $input >$tmp
+
set `wc -l $tmp`
+if test "$1" = "5"; then
+ plan="bsd43"
+fi
-case "$1" in
-5) echo "Patching perly.c to allow dynamic yacc stack allocation";;
-*) mv $input $output; rm -f $tmp; exit;;
-esac
+if test "$plan" = "unknown"; then
+ # Test for ISC 2.2 version.
+egrep 'YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];
+int[ ]*yys\[ *YYMAXDEPTH *\] *;
+yyps *= *&yys\[ *-1 *\];
+yypv *= *&yyv\[ *-1 *\];
+if *\( *\+\+yy_ps *>= *&yys\[ *YYMAXDEPTH *\] *\)' $input >$tmp
+
+ set `wc -l $tmp`
+ if test "$1" = "5"; then
+ plan="isc"
+ fi
+fi
-cat >$tmp <<'END'
+case "$plan" in
+ #######################################################
+ "bsd43")
+ echo "Patching perly.c to allow dynamic yacc stack allocation"
+ echo "Assuming bsd4.3 yaccpar"
+ cat >$tmp <<'END'
/YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];/c\
int yymaxdepth = YYMAXDEPTH;\
YYSTYPE *yyv; /* where the values are stored */\
/yacc stack overflow.*}/d
/yacc stack overflow/,/}/d
END
+ sed -f $tmp <$input >$output ;;
+
+ #######################################################
+ "isc") # Interactive Systems 2.2 version
+ echo "Patching perly.c to allow dynamic yacc stack allocation"
+ echo "Assuming Interactive SysVr3 2.2 yaccpar"
+ # Easier to simply put whole script here than to modify the
+ # bsd script with sed.
+ # Main changes: yaccpar sometimes uses yy_ps and yy_pv
+ # which are local register variables.
+ # if(++yyps > YYMAXDEPTH) had opening brace on next line.
+ # I've kept that brace in along with a call to yyerror if
+ # realloc fails. (Actually, I just don't know how to do
+ # multi-line matches in sed.)
+ cat > $tmp << 'END'
+/YYSTYPE[ ]*yyv\[ *YYMAXDEPTH *\];/c\
+int yymaxdepth = YYMAXDEPTH;\
+YYSTYPE *yyv; /* where the values are stored */\
+int *yys;\
+int *maxyyps;
+
+/int[ ]*yys\[ *YYMAXDEPTH *\] *;/d
+
+/yyps *= *&yys\[ *-1 *\];/d
+
+/yypv *= *&yyv\[ *-1 *\];/c\
+\ if (!yyv) {\
+\ yyv = (YYSTYPE*) malloc(yymaxdepth * sizeof(YYSTYPE));\
+\ yys = (int*) malloc(yymaxdepth * sizeof(int));\
+\ maxyyps = &yys[yymaxdepth];\
+\ }\
+\ yyps = &yys[-1];\
+\ yypv = &yyv[-1];
+
+/if *( *\+\+yy_ps *>= *&yys\[ *YYMAXDEPTH *\] *)/c\
+\ if( ++yy_ps >= maxyyps ) {\
+\ int tv = yy_pv - yyv;\
+\ int ts = yy_ps - yys;\
+\
+\ yymaxdepth *= 2;\
+\ yyv = (YYSTYPE*)realloc((char*)yyv,\
+\ yymaxdepth*sizeof(YYSTYPE));\
+\ yys = (int*)realloc((char*)yys,\
+\ yymaxdepth*sizeof(int));\
+\ yy_ps = yyps = yys + ts;\
+\ yy_pv = yypv = yyv + tv;\
+\ maxyyps = &yys[yymaxdepth];\
+\ }\
+\ if (yyv == NULL || yys == NULL)
+END
+ sed -f $tmp < $input > $output ;;
+
+ ######################################################
+ # Plan still unknown
+ *) mv $input $output;
+esac
-sed -f $tmp <$input >$output
rm -rf $tmp $input
* blame Henry for some of the lack of readability.
*/
-/* $Header: regcomp.c,v 4.0 91/03/20 01:39:01 lwall Locked $
+/* $RCSfile: regcomp.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:04:45 $
*
* $Log: regcomp.c,v $
+ * Revision 4.0.1.1 91/04/12 09:04:45 lwall
+ * patch1: random cleanup in cpp namespace
+ *
* Revision 4.0 91/03/20 01:39:01 lwall
* 4.0 baseline.
*
((*s) == '{' && regcurly(s)))
#define META "^$.[()|?+*\\"
+#ifdef SPSTART
+#undef SPSTART /* dratted cpp namespace... */
+#endif
/*
* Flags to be passed up and down.
*/
* blame Henry for some of the lack of readability.
*/
-/* $Header: regexec.c,v 4.0 91/03/20 01:39:16 lwall Locked $
+/* $RCSfile: regexec.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:07:39 $
*
* $Log: regexec.c,v $
+ * Revision 4.0.1.1 91/04/12 09:07:39 lwall
+ * patch1: regexec only allocated space for 9 subexpresssions
+ *
* Revision 4.0 91/03/20 01:39:16 lwall
* 4.0 baseline.
*
static char *reglastparen; /* Similarly for lastparen. */
static char *regtill;
-static char *regmystartp[10]; /* For remembering backreferences. */
-static char *regmyendp[10];
+static int regmyp_size = 0;
+static char **regmystartp = Null(char**);
+static char **regmyendp = Null(char**);
/*
* Forwards.
/* see how far we have to get to not match where we matched before */
regtill = string+minend;
+ /* Allocate our backreference arrays */
+ if ( regmyp_size < prog->nparens + 1 ) {
+ /* Allocate or enlarge the arrays */
+ regmyp_size = prog->nparens + 1;
+ if ( regmyp_size < 10 ) regmyp_size = 10; /* minimum */
+ if ( regmystartp ) {
+ /* reallocate larger */
+ Renew(regmystartp,regmyp_size,char*);
+ Renew(regmyendp, regmyp_size,char*);
+ }
+ else {
+ /* Initial allocation */
+ New(1102,regmystartp,regmyp_size,char*);
+ New(1102,regmyendp, regmyp_size,char*);
+ }
+
+ }
+
/* Simplest case: anchored match need be tried only once. */
/* [unless multiline is set] */
if (prog->reganch & 1) {
-/* $Header: stab.c,v 4.0 91/03/20 01:39:41 lwall Locked $
+/* $RCSfile: stab.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:10:24 $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: stab.c,v $
+ * Revision 4.0.1.1 91/04/12 09:10:24 lwall
+ * patch1: Configure now differentiates getgroups() type from getgid() type
+ * patch1: you may now use "die" and "caller" in a signal handler
+ *
* Revision 4.0 91/03/20 01:39:41 lwall
* 4.0 baseline.
*
#define NGROUPS 32
#endif
{
- GIDTYPE gary[NGROUPS];
+ GROUPSTYPE gary[NGROUPS];
i = getgroups(NGROUPS,gary);
while (--i >= 0) {
int sig;
{
STAB *stab;
- ARRAY *savearray;
STR *str;
- CMD *oldcurcmd = curcmd;
int oldsave = savestack->ary_fill;
- ARRAY *oldstack = stack;
- CSV *oldcurcsv = curcsv;
+ int oldtmps_base = tmps_base;
+ register CSV *csv;
SUBR *sub;
#ifdef OS2 /* or anybody else who requires SIG_ACK */
signal(sig, SIG_ACK);
#endif
- curcsv = Nullcsv;
stab = stabent(
str_get(hfetch(stab_hash(sigstab),sig_name[sig],strlen(sig_name[sig]),
TRUE)), TRUE);
sig_name[sig], stab_name(stab) );
return;
}
- savearray = stab_xarray(defstab);
- stab_xarray(defstab) = stack = anew(defstab);
+ saveaptr(&stack);
+ str = Str_new(15, sizeof(CSV));
+ str->str_state = SS_SCSV;
+ (void)apush(savestack,str);
+ csv = (CSV*)str->str_ptr;
+ csv->sub = sub;
+ csv->stab = stab;
+ csv->curcsv = curcsv;
+ csv->curcmd = curcmd;
+ csv->depth = sub->depth;
+ csv->wantarray = G_SCALAR;
+ csv->hasargs = TRUE;
+ csv->savearray = stab_xarray(defstab);
+ csv->argarray = stab_xarray(defstab) = stack = anew(defstab);
stack->ary_flags = 0;
- str = Str_new(71,0);
+ curcsv = csv;
+ str = str_mortal(&str_undef);
str_set(str,sig_name[sig]);
(void)apush(stab_xarray(defstab),str);
sub->depth++;
savelist(sub->tosave->ary_array,sub->tosave->ary_fill);
}
- (void)cmd_exec(sub->cmd,G_SCALAR,1); /* so do it already */
-
- sub->depth--; /* assuming no longjumps out of here */
- str_free(stack->ary_array[0]); /* free the one real string */
- stack->ary_array[0] = Nullstr;
- afree(stab_xarray(defstab)); /* put back old $_[] */
- stab_xarray(defstab) = savearray;
- stack = oldstack;
- if (savestack->ary_fill > oldsave)
- restorelist(oldsave);
- curcmd = oldcurcmd;
- curcsv = oldcurcsv;
+ tmps_base = tmps_max; /* protect our mortal string */
+ (void)cmd_exec(sub->cmd,G_SCALAR,0); /* so do it already */
+ tmps_base = oldtmps_base;
+
+ restorelist(oldsave); /* put everything back */
}
STAB *
-#undef STDSTDIO
-/* $Header: str.c,v 4.0 91/03/20 01:39:55 lwall Locked $
+/* $RCSfile: str.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:15:30 $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: str.c,v $
+ * Revision 4.0.1.1 91/04/12 09:15:30 lwall
+ * patch1: fixed undefined environ problem
+ * patch1: substr($ENV{"PATH"},0,0) = "/foo:" didn't modify environment
+ * patch1: $foo .= <BAR> could cause core dump for certain lengths of $foo
+ *
* Revision 4.0 91/03/20 01:39:55 lwall
* 4.0 baseline.
*
#include "perl.h"
#include "perly.h"
-#ifndef __STDC__
-extern char **environ;
-#endif /* ! __STDC__ */
-
#ifndef str_get
char *
str_get(str)
*--bigend = *--midend;
(void)bcopy(little,big+offset,littlelen);
bigstr->str_cur += i;
+ STABSET(bigstr);
return;
}
else if (i == 0) {
(void)bcopy(little,bigstr->str_ptr+offset,len);
+ STABSET(bigstr);
return;
}
str->str_nok = 0; /* invalidate number */
str->str_pok = 1; /* validate pointer */
if (str->str_len <= cnt + 1) { /* make sure we have the room */
- if (cnt > 80 && str->str_len > 0) {
- shortbuffered = cnt - str->str_len + 1;
- cnt = str->str_len - 1;
+ if (cnt > 80 && str->str_len > append) {
+ shortbuffered = cnt - str->str_len + append + 1;
+ cnt -= shortbuffered;
}
else {
shortbuffered = 0;
-/* $Header: str.h,v 4.0 91/03/20 01:40:04 lwall Locked $
+/* $RCSfile: str.h,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:16:12 $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: str.h,v $
+ * Revision 4.0.1.1 91/04/12 09:16:12 lwall
+ * patch1: you may now use "die" and "caller" in a signal handler
+ *
* Revision 4.0 91/03/20 01:40:04 lwall
* 4.0 baseline.
*
#define SS_SHPTR 7 /* HASH* on save stack */
#define SS_SNSTAB 8 /* non-stab on save stack */
#define SS_SCSV 9 /* callsave structure on save stack */
+#define SS_SAPTR 10 /* ARRAY* on save stack */
#define SS_HASH 253 /* carrying an hash */
#define SS_ARY 254 /* carrying an array */
#define SS_FREE 255 /* in free list */
-/* $Header: toke.c,v 4.0 91/03/20 01:42:14 lwall Locked $
+/* $RCSfile: toke.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:18:18 $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: toke.c,v $
+ * Revision 4.0.1.1 91/04/12 09:18:18 lwall
+ * patch1: perl -de "print" wouldn't stop at the first statement
+ *
* Revision 4.0 91/03/20 01:42:14 lwall
* 4.0 baseline.
*
/* This does similarly for list operators, merely by pretending that the
* paren came before the listop rather than after.
*/
-#define LOP(f) return(*s == '(' || (s = skipspace(s), *s == '(') ? \
+#define LOP(f) return(CLINE, *s == '(' || (s = skipspace(s), *s == '(') ? \
(*s = META('('), bufptr = oldbufptr, '(') : \
(yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP))
/* grandfather return to old style */
int f;
char *s;
{
+ CLINE;
if (*s != '(')
s = skipspace(s);
if (*s == '(') {
-/* $Header: util.c,v 4.0 91/03/20 01:56:39 lwall Locked $
+/* $RCSfile: util.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:19:25 $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: util.c,v $
+ * Revision 4.0.1.1 91/04/12 09:19:25 lwall
+ * patch1: random cleanup in cpp namespace
+ *
* Revision 4.0 91/03/20 01:56:39 lwall
* 4.0 baseline.
*
}
}
-#ifndef VARARGS
+#ifndef I_VARARGS
/*VARARGS1*/
mess(pat,a1,a2,a3,a4)
char *pat;
}
#endif
-#ifndef __STDC__
-extern char **environ;
-#endif
-
void
setenv(nam,val)
char *nam, *val;
#endif
#endif
-#ifdef VARARGS
+#ifdef I_VARARGS
#ifndef HAS_VPRINTF
#ifdef CHARVSPRINTF
fakebuf._ptr = dest;
fakebuf._cnt = 32767;
+#ifndef _IOSTRG
+#define _IOSTRG 0
+#endif
fakebuf._flag = _IOWRT|_IOSTRG;
_doprnt(pat, args, &fakebuf); /* what a kludge */
(void)putc('\0', &fakebuf);
}
#endif
#endif /* HAS_VPRINTF */
-#endif /* VARARGS */
+#endif /* I_VARARGS */
#ifdef MYSWAP
#if BYTEORDER != 0x4321