Configure had difficulties if the user's path had weird components.
Now Configure appends the user's path to its own.
Some machines need <netinet/in.h> included in order to define
certain macros for packing or unpacking network order data.
On Suns, the shared library is used by default. If it doesn't
contain something contained in /lib/libc.a, then Configure was
getting things wrong (such as gethostent()). Now Configure uses
the shared library if it's there in preference to libc.a.
When gcc was selected as the compiler, the cc flags defaulted to
-fpcc_struct_return. Unfortunately, the underlines should be hyphens.
Configure figures out if BSD shadow passwords are installed and
the getpw* routines now return slightly different data in the
affected fields.
Some of the prompts in Configure with regard to gid and uid types
were unclear as to their intended use. They are now a little
clearer.
Sometimes you could change a .h file and taintperl and suidperl
didn't get remade correctly because of missing dependencies
in the Makefile.
The README file was misleading about the fact that you have to
say "make test" before you can "cd t; TEST"
The reverse operator was busted in two different ways. Should work
better now. There are now regression tests for it.
Some of the optimizations that perl does are disabled after period
of time if perl decides they aren't doing any good. One of these
caused a string to be freed that was later referenced via another
pointer, causing core dumps. The free turned out to be unnecessary,
so it was removed.
The unless modifier was broken when run under the debugger, due to
the invert() routine in perl.y inverting the logic on the DB
subroutine call instead of the command the unless was modifying.
Configure vfork test was backwards. It now works like other defines.
The numeric switch optimization was broken, and caused code to be
bypassed. This has been fixed.
A split in a subroutine that has no target splits into @_.
Unfortunately, this wrongly freed any referenced arguments passed
in through @_, causing confusing behavior later in the program.
File globbing (<foo.*>) left one orphaned string each time it
called the shell to do the glob.
RCS expanded an unintended $Header in lib/perldb.pl. This has
been fixed simply by replacing the $ with a .
Some forward declarations of static functions were missing from
malloc.c.
There's a strut in malloc for mips machines to extend the overhead
union to the size of a double. This was also enabled for sparc
machines.
DEC risc machines are reported to have a buggy memcmp. I've put
some conditional code into perl.h which I think will undef MEMCMP
appropriately.
In perl.man.4, I documented the desirability of using parens even
where they aren't strictly necessary.
I've grandfathered "format stdout" to be the same as "format STDOUT".
Unary operators can be called with no argument. The corresponding
function call form using empty parens () didn't work right, though
it did for certain functions in 2.0. It now works in 3.0.
The string ordering tests were wrong for pairs of strings in which
one string was a prefix of the other. This affected lt, le, gt,
ge, and the sort operator when used with no subroutine.
$/ didn't work with the stupid code used when STDSTDIO was undefined.
The stupid code has been replaced with smarter code that can do
it right. Special thanks to Piet van Oostrum for the code.
Goulds work better if the union in STR is at an 8 byte boundary.
The fields were rearranged somewhat to provide this.
"sort keys %a" should now work right (though parens are still
desirable for readability).
bcopy() needed a forward declaration on some machines.
In x2p/Makefile.SH, added dependency on ../config.sh so that it
gets linked down from above if it got removed for some reason.
# and edit it to reflect your system. Some packages may include samples
# of config.h for certain machines, so you might look for one of those.)
#
-# $Header: Configure,v 3.0 89/10/18 15:04:55 lwall Locked $
+# $Header: Configure,v 3.0.1.1 89/10/26 22:58:02 lwall Locked $
#
# Yes, you may rip this off to use in other distribution packages.
# (Note: this Configure script was generated automatically. Rather than
# working with this copy of Configure, you may wish to get metaconfig.)
: sanity checks
-PATH='.:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin'
+PATH=".:/bin:/usr/bin:/usr/local/bin:/usr/ucb:/usr/local:/usr/lbin:/etc:/usr/new:/usr/new/bin:/usr/nbin:$PATH"
export PATH || (echo "OOPS, this isn't sh. Desperation time. I will feed myself to sh."; sh $0; kill $$)
if test ! -t 0; then
d_dirnamlen=''
i_fcntl=''
i_grp=''
+i_niin=''
i_pwd=''
d_pwquota=''
d_pwage=''
cpp
egrep
test
-uname
"
for file in $loclist; do
xxx=`loc $file $file $pth`
rmlist="$rmlist loc"
: get list of predefined functions in a handy place
-if $test -n "$uname"; then
- os=`$uname -s`
-else
- os=unknown
-fi
echo " "
-if test -f /lib/libc.a; then
+set /usr/lib/libc.so.[0-9]*
+eval set \$$#
+if test -f "$1"; then
+ echo "Your shared C library is in $1."
+ libc="$1"
+elif test -f /lib/libc.a; then
echo "Your C library is in /lib/libc.a. You're normal."
libc=/lib/libc.a
else
- if test "$os" = DomainOS ; then
- ans=`loc libc blurfl/dyick $libpth`
- else
- ans=`loc libc.a blurfl/dyick $libpth`
- fi
+ ans=`loc libc.a blurfl/dyick $libpth`
if test ! -f "$ans"; then
ans=`loc clib blurfl/dyick $libpth`
fi
if $contains '^printf$' libc.list >/dev/null 2>&1; then
echo "done"
else
- if test "$os" = DomainOS ; then
- $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
- else
+ $sed -n -e 's/^__*//' -e 's/^\([a-zA-Z_0-9$]*\).*xtern.*/\1/p' <libc.tmp >libc.list
+ $contains '^printf$' libc.list >/dev/null 2>&1 || \
$sed -n -e 's/^.* D __*//p' -e 's/^.* D //p' <libc.tmp >libc.list
- fi
$contains '^printf$' libc.list >/dev/null 2>&1 || \
$sed -n -e 's/^_//' \
-e 's/^\([a-zA-Z_0-9]*\).*xtern.*text.*/\1/p' <libc.tmp >libc.list
case "$ccflags" in
'') case "$cc" in
- gcc) dflt='-fpcc_struct_return';;
+ gcc) dflt='-fpcc-struct-return';;
*) dflt='none';;
esac
;;
echo "dbm.h not found."
fi
-: see if this is an pwd system
+: see if this is a pwd system
echo " "
if $test -r /usr/include/pwd.h ; then
i_pwd="$define"
else
d_pwage="$undef"
fi
+ if $contains 'pw_change' /usr/include/pwd.h >/dev/null 2>&1; then
+ d_pwchange="$define"
+ else
+ d_pwchange="$undef"
+ fi
+ if $contains 'pw_class' /usr/include/pwd.h >/dev/null 2>&1; then
+ d_pwclass="$define"
+ else
+ d_pwclass="$undef"
+ fi
+ if $contains 'pw_expire' /usr/include/pwd.h >/dev/null 2>&1; then
+ d_pwexpire="$define"
+ else
+ d_pwexpire="$undef"
+ fi
else
i_pwd="$undef"
d_pwquota="$undef"
d_pwage="$undef"
+ d_pwchange="$undef"
+ d_pwclass="$undef"
+ d_pwexpire="$undef"
echo "No pwd.h found."
fi
esac
cont=true
echo " "
-rp="What type are group ids on this system declared as? [$dflt]"
+rp="What type are the group ids are returned by getgroups()? [$dflt]"
$echo $n "$rp $c"
. myread
gidtype="$ans"
echo "No grp.h found."
fi
+: see if this is a netinet/in.h system
+echo " "
+if $test -r /usr/include/netinet/in.h ; then
+ i_niin="$define"
+ echo "netinet/in.h found."
+else
+ i_niin="$undef"
+ echo "No netinet/in.h found."
+fi
+
: see if this is a sys/dir.h system
echo " "
if $test -r /usr/include/sys/dir.h ; then
esac
cont=true
echo " "
-rp="What type are user ids on this system declared as? [$dflt]"
+rp="What type are user ids returned by getuid(), etc.? [$dflt]"
$echo $n "$rp $c"
. myread
uidtype="$ans"
d_dirnamlen='$d_dirnamlen'
i_fcntl='$i_fcntl'
i_grp='$i_grp'
+i_niin='$i_niin'
i_pwd='$i_pwd'
d_pwquota='$d_pwquota'
d_pwage='$d_pwage'
echo "Extracting Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
-# $Header: Makefile.SH,v 3.0 89/10/18 15:06:43 lwall Locked $
+# $Header: Makefile.SH,v 3.0.1.1 89/10/26 23:00:38 lwall Locked $
#
# $Log: Makefile.SH,v $
+# Revision 3.0.1.1 89/10/26 23:00:38 lwall
+# patch1: Makefile.SH needed some more .h dependecies
+#
# Revision 3.0 89/10/18 15:06:43 lwall
# 3.0 baseline
#
# Replicating all this junk is yucky, but I don't see a portable way to fix it.
-tperl.o: perl.c perly.h perl.h EXTERN.h regexp.h util.h INTERN.h handy.h \
- config.h stab.h
+tperl.o: perl.c perly.h $(h)
/bin/rm -f tperl.c
$(SLN) perl.c tperl.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperl.c
/bin/rm -f tperl.c
-tperly.o: perly.c
+tperly.o: perly.c perly.h $(h)
/bin/rm -f tperly.c
$(SLN) perly.c tperly.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tperly.c
/bin/rm -f tperly.c
-sperly.o: perly.c perl.h handy.h perly.h patchlevel.h
+sperly.o: perly.c perly.h patchlevel.h $(h)
/bin/rm -f sperly.c
$(SLN) perly.c sperly.c
$(CC) -c -DTAINT -DIAMSUID $(CFLAGS) $(LARGE) sperly.c
/bin/rm -f sperly.c
-tarray.o: array.c
+tarray.o: array.c $(h)
/bin/rm -f tarray.c
$(SLN) array.c tarray.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tarray.c
/bin/rm -f tarray.c
-tcmd.o: cmd.c
+tcmd.o: cmd.c $(h)
/bin/rm -f tcmd.c
$(SLN) cmd.c tcmd.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcmd.c
/bin/rm -f tcmd.c
-tcons.o: cons.c
+tcons.o: cons.c $(h)
/bin/rm -f tcons.c
$(SLN) cons.c tcons.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tcons.c
/bin/rm -f tcons.c
-tconsarg.o: consarg.c
+tconsarg.o: consarg.c $(h)
/bin/rm -f tconsarg.c
$(SLN) consarg.c tconsarg.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tconsarg.c
/bin/rm -f tconsarg.c
-tdoarg.o: doarg.c
+tdoarg.o: doarg.c $(h)
/bin/rm -f tdoarg.c
$(SLN) doarg.c tdoarg.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoarg.c
/bin/rm -f tdoarg.c
-tdoio.o: doio.c
+tdoio.o: doio.c $(h)
/bin/rm -f tdoio.c
$(SLN) doio.c tdoio.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdoio.c
/bin/rm -f tdoio.c
-tdolist.o: dolist.c
+tdolist.o: dolist.c $(h)
/bin/rm -f tdolist.c
$(SLN) dolist.c tdolist.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdolist.c
/bin/rm -f tdolist.c
-tdump.o: dump.c
+tdump.o: dump.c $(h)
/bin/rm -f tdump.c
$(SLN) dump.c tdump.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tdump.c
/bin/rm -f tdump.c
-teval.o: eval.c
+teval.o: eval.c $(h)
/bin/rm -f teval.c
$(SLN) eval.c teval.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) teval.c
/bin/rm -f teval.c
-tform.o: form.c
+tform.o: form.c $(h)
/bin/rm -f tform.c
$(SLN) form.c tform.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tform.c
/bin/rm -f tform.c
-thash.o: hash.c
+thash.o: hash.c $(h)
/bin/rm -f thash.c
$(SLN) hash.c thash.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) thash.c
/bin/rm -f thash.c
-tregcomp.o: regcomp.c
+tregcomp.o: regcomp.c $(h)
/bin/rm -f tregcomp.c
$(SLN) regcomp.c tregcomp.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregcomp.c
/bin/rm -f tregcomp.c
-tregexec.o: regexec.c
+tregexec.o: regexec.c $(h)
/bin/rm -f tregexec.c
$(SLN) regexec.c tregexec.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tregexec.c
/bin/rm -f tregexec.c
-tstab.o: stab.c
+tstab.o: stab.c $(h)
/bin/rm -f tstab.c
$(SLN) stab.c tstab.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstab.c
/bin/rm -f tstab.c
-tstr.o: str.c
+tstr.o: str.c $(h)
/bin/rm -f tstr.c
$(SLN) str.c tstr.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tstr.c
/bin/rm -f tstr.c
-ttoke.o: toke.c
+ttoke.o: toke.c $(h)
/bin/rm -f ttoke.c
$(SLN) toke.c ttoke.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) ttoke.c
/bin/rm -f ttoke.c
-tutil.o: util.c
+tutil.o: util.c $(h)
/bin/rm -f tutil.c
$(SLN) util.c tutil.c
$(CC) -c -DTAINT $(CFLAGS) $(LARGE) tutil.c
mv y.tab.c perl.c
mv y.tab.h perly.h
-perl.o: perl.c perly.h perl.h EXTERN.h regexp.h util.h INTERN.h handy.h \
- config.h arg.h stab.h
+perl.o: perl.c perly.h $(h)
$(CC) -c $(CFLAGS) $(LARGE) perl.c
perl.man: perl.man.1 perl.man.2 perl.man.3 perl.man.4 patchlevel.h perl
This will run the regression tests on the perl you just made.
If it doesn't say "All tests successful" then something went wrong.
See the README in the t subdirectory. Note that you can't run it
- in background if this disables opening of /dev/tty. If in doubt, just
- cd to the t directory and run TEST by hand.
+ in background if this disables opening of /dev/tty. If "make test"
+ bombs out, just cd to the t directory and run TEST by hand to see if
+ it makes any difference.
6) make install
-/* $Header: arg.h,v 3.0 89/10/18 15:08:27 lwall Locked $
+/* $Header: arg.h,v 3.0.1.1 89/10/26 23:02:35 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: arg.h,v $
+ * Revision 3.0.1.1 89/10/26 23:02:35 lwall
+ * patch1: reverse didn't work
+ *
* Revision 3.0 89/10/18 15:08:27 lwall
* 3.0 baseline
*
A(3,3,0), /* AASSIGN */
A(0,0,0), /* SASSIGN */
A(0,0,0), /* DUMP */
- A(0,0,0), /* REVERSE */
+ A(0,3,0), /* REVERSE */
A(1,0,0), /* ADDROF */
A(1,1,1), /* SOCKET */
A(1,1,0), /* BIND */
-/* $Header: cmd.c,v 3.0 89/10/18 15:09:02 lwall Locked $
+/* $Header: cmd.c,v 3.0.1.1 89/10/26 23:04:21 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: cmd.c,v $
+ * Revision 3.0.1.1 89/10/26 23:04:21 lwall
+ * patch1: heuristically disabled optimization could cause core dump
+ *
* Revision 3.0 89/10/18 15:09:02 lwall
* 3.0 baseline
*
}
}
if (--cmd->c_short->str_u.str_useful < 0) {
- str_free(cmd->c_short);
- cmd->c_short = Nullstr;
cmdflags &= ~CF_OPTIMIZE;
cmdflags |= CFT_EVAL; /* never try this optimization again */
cmd->c_flags = cmdflags;
-/* $Header: cmd.h,v 3.0 89/10/18 15:09:15 lwall Locked $
+/* $Header: cmd.h,v 3.0.1.1 89/10/26 23:05:43 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: cmd.h,v $
+ * Revision 3.0.1.1 89/10/26 23:05:43 lwall
+ * patch1: unless was broken when run under the debugger
+ *
* Revision 3.0 89/10/18 15:09:15 lwall
* 3.0 baseline
*
#define CF_ONCE 010000 /* we've already pushed the label on the stack */
#define CF_FLIP 020000 /* on a match do flipflop */
#define CF_TERM 040000 /* value of this cmd might be returned */
+#define CF_DBSUB 0100000 /* this is an inserted cmd for debugging */
#define CFT_FALSE 0 /* c_expr is always false */
#define CFT_TRUE 1 /* c_expr is always true */
*/
#$d_varargs VARARGS /**/
-/* vfork:
- * This symbol, if defined, remaps the vfork routine to fork if the
- * vfork() routine isn't supported here.
+/* VFORK:
+ * This symbol, if defined, indicates that vfork() exists.
*/
-#$d_vfork vfork fork /**/
+#$d_vfork VFORK /**/
/* VOIDSIG:
* This symbol is defined if this system declares "void (*signal())()" in
*/
#$i_grp I_GRP /**/
+/* I_NETINET_IN:
+ * This symbol, if defined, indicates to the C program that it should
+ * include netinet/in.h.
+ */
+#$i_niin I_NETINET_IN /**/
+
/* I_PWD:
* This symbol, if defined, indicates to the C program that it should
* include pwd.h.
* This symbol, if defined, indicates to the C program that struct passwd
* contains pw_age.
*/
+/* PWCHANGE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_change.
+ */
+/* PWCLASS:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_class.
+ */
+/* PWEXPIRE:
+ * This symbol, if defined, indicates to the C program that struct passwd
+ * contains pw_expire.
+ */
#$i_pwd I_PWD /**/
#$d_pwquota PWQUOTA /**/
#$d_pwage PWAGE /**/
+#$d_pwage PWCHANGE /**/
+#$d_pwage PWCLASS /**/
+#$d_pwage PWEXPIRE /**/
/* I_SYSDIR:
* This symbol, if defined, indicates to the C program that it should
-/* $Header: cons.c,v 3.0 89/10/18 15:10:23 lwall Locked $
+/* $Header: cons.c,v 3.0.1.1 89/10/26 23:09:01 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: cons.c,v $
+ * Revision 3.0.1.1 89/10/26 23:09:01 lwall
+ * patch1: numeric switch optimization was broken
+ * patch1: unless was broken when run under the debugger
+ *
* Revision 3.0 89/10/18 15:10:23 lwall
* 3.0 baseline
*
Newz(105,loc, max - min + 3, CMD*);
loc++;
+ max -= min;
+ max++;
while (count--) {
i = (int)str_gnum(cur->c_short);
i -= min;
- max -= min;
- max++;
switch(cur->c_slen) {
case O_LE:
i++;
}
loc--;
min--;
+ max++;
for (i = 0; i <= max; i++)
if (!loc[i])
loc[i] = cur;
stab2arg(A_WORD,DBstab),
make_list(arg),
Nullarg);
- cmd->c_flags |= CF_COND;
+ cmd->c_flags |= CF_COND|CF_DBSUB;
cmd->c_line = head->c_line;
cmd->c_label = head->c_label;
cmd->c_file = filename;
CMD *
invert(cmd)
-register CMD *cmd;
+CMD *cmd;
{
- if (cmd->c_head)
- cmd->c_head->c_flags ^= CF_INVERT;
- else
- cmd->c_flags ^= CF_INVERT;
+ register CMD *targ = cmd;
+ if (targ->c_head)
+ targ = targ->c_head;
+ if (targ->c_flags & CF_DBSUB)
+ targ = targ->c_next;
+ targ->c_flags ^= CF_INVERT;
return cmd;
}
-/* $Header: doio.c,v 3.0 89/10/18 15:10:54 lwall Locked $
+/* $Header: doio.c,v 3.0.1.1 89/10/26 23:10:05 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: doio.c,v $
+ * Revision 3.0.1.1 89/10/26 23:10:05 lwall
+ * patch1: Configure now checks for BSD shadow passwords
+ *
* Revision 3.0 89/10/18 15:10:54 lwall
* 3.0 baseline
*
(void)astore(ary, ++sp, str = str_static(&str_no));
str_numset(str, (double)pwent->pw_gid);
(void)astore(ary, ++sp, str = str_static(&str_no));
+#ifdef PWCHANGE
+ str_numset(str, (double)pwent->pw_change);
+#else
#ifdef PWQUOTA
str_numset(str, (double)pwent->pw_quota);
#else
str_set(str, pwent->pw_age);
#endif
#endif
+#endif
(void)astore(ary, ++sp, str = str_static(&str_no));
+#ifdef PWCLASS
+ str_set(str,pwent->pw_class);
+#else
str_set(str, pwent->pw_comment);
+#endif
(void)astore(ary, ++sp, str = str_static(&str_no));
str_set(str, pwent->pw_gecos);
(void)astore(ary, ++sp, str = str_static(&str_no));
str_set(str, pwent->pw_dir);
(void)astore(ary, ++sp, str = str_static(&str_no));
str_set(str, pwent->pw_shell);
+#ifdef PWEXPIRE
+ (void)astore(ary, ++sp, str = str_static(&str_no));
+ str_numset(str, (double)pwent->pw_expire);
+#endif
}
return sp;
-/* $Header: dolist.c,v 3.0 89/10/18 15:11:02 lwall Locked $
+/* $Header: dolist.c,v 3.0.1.1 89/10/26 23:11:51 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: dolist.c,v $
+ * Revision 3.0.1.1 89/10/26 23:11:51 lwall
+ * patch1: split in a subroutine wrongly freed referenced arguments
+ * patch1: reverse didn't work
+ *
* Revision 3.0 89/10/18 15:11:02 lwall
* 3.0 baseline
*
#endif
ary = stab_xarray(spat->spat_repl[1].arg_ptr.arg_stab);
if (ary && ((ary->ary_flags & ARF_REAL) || gimme != G_ARRAY)) {
- ary->ary_flags |= ARF_REAL;
realarray = 1;
+ if (!(ary->ary_flags & ARF_REAL)) {
+ ary->ary_flags |= ARF_REAL;
+ for (i = ary->ary_fill; i >= 0; i--)
+ ary->ary_array[i] = Nullstr; /* don't free mere refs */
+ }
ary->ary_fill = -1;
sp = -1; /* temporarily switch stacks */
}
}
while (i-- > 0) {
*up++ = *down;
- *down-- = *up;
+ if (i-- > 0)
+ *down-- = *up;
}
+ i = arglast[2] - arglast[1];
+ Copy(down+1,up,i/2,STR*);
return arglast[2] - 1;
}
* kit sizes from getting too big.
*/
-/* $Header: evalargs.xc,v 3.0 89/10/18 15:17:16 lwall Locked $
+/* $Header: evalargs.xc,v 3.0.1.1 89/10/26 23:12:55 lwall Locked $
*
* $Log: evalargs.xc,v $
+ * Revision 3.0.1.1 89/10/26 23:12:55 lwall
+ * patch1: glob didn't free a temporary string
+ *
* Revision 3.0 89/10/18 15:17:16 lwall
* 3.0 baseline
*
}
(void)do_open(last_in_stab,tmpstr->str_ptr);
fp = stab_io(last_in_stab)->ifp;
+ str_free(tmpstr);
}
}
}
package DB;
-$header = '$Header: perldb.pl,v 3.0 89/10/18 15:19:46 lwall Locked $';
+$header = '$Header: perldb.pl,v 3.0.1.1 89/10/26 23:14:02 lwall Locked $';
#
# This file is automatically included if you do perl -d.
# It's probably not useful to include this yourself.
# have a breakpoint. It also inserts a do 'perldb.pl' before the first line.
#
# $Log: perldb.pl,v $
+# Revision 3.0.1.1 89/10/26 23:14:02 lwall
+# patch1: RCS expanded an unintended $Header in lib/perldb.pl
+#
# Revision 3.0 89/10/18 15:19:46 lwall
# 3.0 baseline
#
select(STDOUT);
$| = 1; # for real STDOUT
-$header =~ s/\$Header: perldb.pl,v 3.0 89/10/18 15:19:46 lwall Locked $/$1$2/;
+$header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
print OUT "\nLoading DB from $header\n\n";
sub DB {
-/* $Header: malloc.c,v 3.0 89/10/18 15:20:39 lwall Locked $
+/* $Header: malloc.c,v 3.0.1.1 89/10/26 23:15:05 lwall Locked $
*
* $Log: malloc.c,v $
+ * Revision 3.0.1.1 89/10/26 23:15:05 lwall
+ * patch1: some declarations were missing from malloc.c
+ * patch1: sparc machines had alignment problems in malloc.c
+ *
* Revision 3.0 89/10/18 15:20:39 lwall
* 3.0 baseline
*
#include "EXTERN.h"
#include "perl.h"
+static findbucket(), morecore();
+
/* I don't much care whether these are defined in sys/types.h--LAW */
#define u_char unsigned char
*/
union overhead {
union overhead *ov_next; /* when free */
-#ifdef mips
+#if defined (mips) || defined (sparc)
double strut; /* alignment problems */
#endif
struct {
-#define PATCHLEVEL 0
+#define PATCHLEVEL 1
-/* $Header: perl.h,v 3.0 89/10/18 15:21:21 lwall Locked $
+/* $Header: perl.h,v 3.0.1.1 89/10/26 23:17:08 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: perl.h,v $
+ * Revision 3.0.1.1 89/10/26 23:17:08 lwall
+ * patch1: vfork now conditionally defined based on VFORK
+ * patch1: DEC risc machines have a buggy memcmp
+ * patch1: perl.h now includes <netinet/in.h> if it exists
+ *
* Revision 3.0 89/10/18 15:21:21 lwall
* 3.0 baseline
*
# endif
#endif
+#ifndef VFORK
+# define vfork fork
+#endif
+
+#if defined(MEMCMP) && defined(mips) && BYTEORDER == 01234
+#undef MEMCMP
+#endif
+
#ifdef MEMCPY
extern char *memcpy(), *memset();
#define bcopy(s1,s2,l) memcpy(s2,s1,l)
#include <setjmp.h>
#include <sys/param.h> /* if this needs types.h we're still wrong */
+#ifdef I_NETINET_IN
+#include <netinet/in.h>
+#endif
+
#ifndef _TYPES_ /* If types.h defines this it's easy. */
#ifndef major /* Does everyone's types.h define this? */
#include <sys/types.h>
''' Beginning of part 4
-''' $Header: perl.man.4,v 3.0 89/10/18 15:21:55 lwall Locked $
+''' $Header: perl.man.4,v 3.0.1.1 89/10/26 23:18:43 lwall Locked $
'''
''' $Log: perl.man.4,v $
+''' Revision 3.0.1.1 89/10/26 23:18:43 lwall
+''' patch1: documented the desirability of unnecessary parentheses
+'''
''' Revision 3.0 89/10/18 15:21:55 lwall
''' 3.0 baseline
'''
The defaults are there for lazy systems programmers writing one-shot
programs.
If you want your program to be readable, consider supplying the argument.
+.Sp
+Along the same lines, just because you
+.I can
+omit parentheses in many places doesn't mean that you ought to:
+.nf
+
+ return print reverse sort num values array;
+ return print(reverse(sort num (values(%array))));
+
+.fi
+When in doubt, parenthesize.
+At the very least it will let some poor schmuck bounce on the % key in vi.
.Ip 2. 4 4
Don't go through silly contortions to exit a loop at the top or the
bottom, when
.Ip 6. 4 4
For portability, when using features that may not be implemented on every
machine, test the construct in an eval to see if it fails.
+If you know what version or patchlevel a particular feature was implemented,
+you can test $] to see if it will be there.
.Ip 4. 4 4
Choose mnemonic indentifiers.
.Ip 5. 4 4
-/* $Header: perl.y,v 3.0 89/10/18 15:22:04 lwall Locked $
+/* $Header: perl.y,v 3.0.1.1 89/10/26 23:20:41 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: perl.y,v $
+ * Revision 3.0.1.1 89/10/26 23:20:41 lwall
+ * patch1: grandfathered "format stdout"
+ * patch1: operator(); is now normally equivalent to operator;
+ *
* Revision 3.0 89/10/18 15:22:04 lwall
* 3.0 baseline
*
;
format : FORMAT WORD '=' FORMLIST
- { stab_form(stabent($2,TRUE)) = $4; Safefree($2);}
+ { if (strEQ($2,"stdout"))
+ stab_form(stabent("STDOUT",TRUE)) = $4;
+ else if (strEQ($2,"stderr"))
+ stab_form(stabent("STDERR",TRUE)) = $4;
+ else
+ stab_form(stabent($2,TRUE)) = $4;
+ Safefree($2);}
| FORMAT '=' FORMLIST
{ stab_form(stabent("STDOUT",TRUE)) = $3; }
;
Nullarg, Nullarg)); }
| FUNC0
{ $$ = make_op($1, 0, Nullarg, Nullarg, Nullarg); }
+ | FUNC1 '(' ')'
+ { $$ = make_op($1, 1, Nullarg, Nullarg, Nullarg);
+ if ($1 == O_EVAL || $1 == O_RESET)
+ $$ = fixeval($$); }
| FUNC1 '(' expr ')'
{ $$ = make_op($1, 1, $3, Nullarg, Nullarg);
if ($1 == O_EVAL || $1 == O_RESET)
-/* $Header: str.c,v 3.0 89/10/18 15:23:38 lwall Locked $
+/* $Header: str.c,v 3.0.1.1 89/10/26 23:23:41 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: str.c,v $
+ * Revision 3.0.1.1 89/10/26 23:23:41 lwall
+ * patch1: string ordering tests were wrong
+ * patch1: $/ now works even when STDSTDIO undefined
+ *
* Revision 3.0 89/10/18 15:23:38 lwall
* 3.0 baseline
*
if (retval = memcmp(str1->str_ptr, str2->str_ptr, str1->str_cur))
return retval;
else
- return 1;
+ return -1;
}
else if (retval = memcmp(str1->str_ptr, str2->str_ptr, str2->str_cur))
return retval;
else if (str1->str_cur == str2->str_cur)
return 0;
else
- return -1;
+ return 1;
}
char *
register FILE *fp;
int append;
{
-#ifdef STDSTDIO /* Here is some breathtakingly efficient cheating */
-
register char *bp; /* we're going to steal some values */
register int cnt; /* from the stdio struct and put EVERYTHING */
register STDCHAR *ptr; /* in the innermost loop into registers */
newline = '\n';
oldbp = Nullch; /* remember last \n position (none) */
}
+#ifdef STDSTDIO /* Here is some breathtakingly efficient cheating */
+
cnt = fp->_cnt; /* get count into register */
str->str_nok = 0; /* invalidate number */
str->str_pok = 1; /* validate pointer */
#else /* !STDSTDIO */ /* The big, slow, and stupid way */
- static char buf[8192];
+ {
+ static char buf[8192];
+ char * bpe = buf + sizeof(buf) - 3;
+
+screamer:
+ bp = buf;
+filler:
+ while ((i = getc(fp)) != EOF && (*bp++ = i) != newline && bp < bpe);
+ if (i == newline && get_paragraph &&
+ (i = getc(fp)) != EOF && (*bp++ = i) != newline && bp < bpe)
+ goto filler;
- if (fgets(buf, sizeof buf, fp) != Nullch) {
+ *bp = '\0';
if (append)
str_cat(str, buf);
else
str_set(str, buf);
+ if (i != newline && i != EOF) {
+ append = -1;
+ goto screamer;
+ }
}
- else
- str_set(str, No);
#endif /* STDSTDIO */
-/* $Header: str.h,v 3.0 89/10/18 15:23:49 lwall Locked $
+/* $Header: str.h,v 3.0.1.1 89/10/26 23:24:42 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: str.h,v $
+ * Revision 3.0.1.1 89/10/26 23:24:42 lwall
+ * patch1: rearranged some structures to align doubles better on Gould
+ *
* Revision 3.0 89/10/18 15:23:49 lwall
* 3.0 baseline
*
struct string {
char * str_ptr; /* pointer to malloced string */
+ int str_len; /* allocated size */
union {
double str_nval; /* numeric value, if any */
STAB *str_stab; /* magic stab for magic "key" string */
HASH *str_hash; /* string represents an assoc array (stab?) */
ARRAY *str_array; /* string represents an array */
} str_u;
- int str_len; /* allocated size */
int str_cur; /* length of str_ptr as a C string */
STR *str_magic; /* while free, link to next free str */
/* while in use, ptr to "key" for magic items */
struct stab { /* should be identical, except for str_ptr */
STBP * str_ptr; /* pointer to malloced string */
+ int str_len; /* allocated size */
union {
double str_nval; /* numeric value, if any */
STAB *str_stab; /* magic stab for magic "key" string */
HASH *str_hash; /* string represents an assoc array (stab?) */
ARRAY *str_array; /* string represents an array */
} str_u;
- int str_len; /* allocated size */
int str_cur; /* length of str_ptr as a C string */
STR *str_magic; /* while free, link to next free str */
/* while in use, ptr to "key" for magic items */
#!./perl
-# $Header: op.sort,v 3.0 89/10/18 15:31:19 lwall Locked $
+# $Header: op.sort,v 3.0.1.1 89/10/26 23:25:37 lwall Locked $
-print "1..3\n";
+print "1..8\n";
sub reverse { $a lt $b ? 1 : $a gt $b ? -1 : 0; }
$x = join('', sort @george, 'to', @harry);
print ($x eq 'AbelAxedCainPunishedcatchaseddoggonetoxyz'?"ok 3\n":"not ok 3\n");
+
+@a = ();
+@b = reverse @a;
+print ("@b" eq "" ? "ok 4\n" : "not ok 4 (@b)\n");
+
+@a = (1);
+@b = reverse @a;
+print ("@b" eq "1" ? "ok 5\n" : "not ok 5 (@b)\n");
+
+@a = (1,2);
+@b = reverse @a;
+print ("@b" eq "2 1" ? "ok 6\n" : "not ok 6 (@b)\n");
+
+@a = (1,2,3);
+@b = reverse @a;
+print ("@b" eq "3 2 1" ? "ok 7\n" : "not ok 7 (@b)\n");
+
+@a = (1,2,3,4);
+@b = reverse @a;
+print ("@b" eq "4 3 2 1" ? "ok 8\n" : "not ok 8 (@b)\n");
-/* $Header: toke.c,v 3.0 89/10/18 15:32:33 lwall Locked $
+/* $Header: toke.c,v 3.0.1.1 89/10/26 23:26:21 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: toke.c,v $
+ * Revision 3.0.1.1 89/10/26 23:26:21 lwall
+ * patch1: disambiguated word after "sort" better
+ *
* Revision 3.0 89/10/18 15:32:33 lwall
* 3.0 baseline
*
fatal("sort is now a reserved word");
if (isascii(*s) && (isalpha(*s) || *s == '_')) {
for (d = s; isalpha(*d) || isdigit(*d) || *d == '_'; d++) ;
- if (d >= bufend || isspace(*d))
+ strncpy(tokenbuf,s,d-s);
+ if (strNE(tokenbuf,"keys") &&
+ strNE(tokenbuf,"values") &&
+ strNE(tokenbuf,"split") &&
+ strNE(tokenbuf,"grep") &&
+ strNE(tokenbuf,"readdir") &&
+ strNE(tokenbuf,"unpack") &&
+ strNE(tokenbuf,"do") &&
+ (d >= bufend || isspace(*d)) )
*(--s) = '\\'; /* force next ident to WORD */
}
LOP(O_SORT);
-/* $Header: util.h,v 3.0 89/10/18 15:33:18 lwall Locked $
+/* $Header: util.h,v 3.0.1.1 89/10/26 23:28:25 lwall Locked $
*
* Copyright (c) 1989, Larry Wall
*
* as specified in the README file that comes with the perl 3.0 kit.
*
* $Log: util.h,v $
+ * Revision 3.0.1.1 89/10/26 23:28:25 lwall
+ * patch1: declared bcopy if necessary
+ *
* Revision 3.0 89/10/18 15:33:18 lwall
* 3.0 baseline
*
char *nsavestr();
FILE *mypopen();
int mypclose();
+#ifndef BCOPY
+#ifndef MEMCPY
+char *bcopy();
+#endif
+#endif
esac
echo "Extracting x2p/Makefile (with variable substitutions)"
cat >Makefile <<!GROK!THIS!
-# $Header: Makefile.SH,v 3.0 89/10/18 15:33:52 lwall Locked $
+# $Header: Makefile.SH,v 3.0.1.1 89/10/26 23:29:11 lwall Locked $
#
# $Log: Makefile.SH,v $
+# Revision 3.0.1.1 89/10/26 23:29:11 lwall
+# patch1: in x2p/Makefile.SH, added dependency on ../config.sh
+#
# Revision 3.0 89/10/18 15:33:52 lwall
# 3.0 baseline
#
shlist:
echo $(sh) | tr ' ' '\012' >.shlist
+config.sh: ../config.sh
+ rm -f config.sh
+ ln ../config.sh .
+
# AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE
$(obj):
@ echo "You haven't done a "'"make depend" yet!'; exit 1