System: perl version 3.0 Patch #: 7 Priority: Medium High Subject: select now works on big-endian machines Subject: send() didn't allow a TO argument Subject: arranged for certain registers to be restored after longjmp() Subject: made nested or recursive foreach work right Subject: a pattern wouldn't match a null string before the first character Subject: certain patterns didn't match correctly at end of string Subject: Configure now compiles a test program to figure out time.h fiasco Subject: Configure now lets you pick between yacc or bison Subject: ANSI strerror() is now supported Subject: errno may now be a macro with an lvalue Subject: Xenix support for sys/ndir.h, cross compilation Subject: Configure now detects DG/UX thingies like [sg]etpgrp2 and utime.h Subject: support for -lnet_s -lnsl_s -lsocket -lx and /usr/include/lan Subject: added some Microport support Subject: Added README documentation for weird machines Subject: Added README file for Microport Subject: grep(1,@array) didn't work Subject: /$pat/; //; wrongly freed runtime pattern twice Subject: ord() now always returns positive even on signed char machines Subject: lib/complete.pl misused @_ array Subject: memcpy() and memset() return void in __STDC__ Subject: documented that s`pat`repl` does command substitution on replacement Subject: documented that $timeleft from select() is likely not implemented Subject: documented that package'filehandle works as well as $package'variable Subject: documented which identifiers are always in package main Subject: allowed setuid scripts to have a space after #! Subject: in stab.c, sighandler() may now return either void or int Subject: -d switch incompatible with -p or -n Subject: " ''$foo'' " didn't parse right Subject: grandfathered m'pat' and s'pat'repl' to not be package qualifiers Subject: arranged so a2p has a chance of running on a 286 Subject: in a2p, user-defined functions didn't work on some machines Description: The select operator didn't interpret bit vectors correctly on non-little-endian machines such as Suns. Rather than bollux up the rather straightforward interpretation of bit vectors, I made the select operator rearrange the bytes as necessary. So it is still true that vec($foo,0,1) refers to the first bit of the first byte of string $foo, even on big-endian machines. The send() socket operator didn't correctly allow you to specify a TO argument even though this was documented. (The TO argument is desirable for sending datagram packets.) In ANSI standard C, they decided that longjmp() didn't have to guarantee anything about registers. Several people sent me some patches that declared certain variables as volatile rather than register for such compilers. Rather than go that route, however, I wanted to keep some of these variables in registers, so I just made sure that the important ones are restored from non-register locations after longjmp(). I think "volatile" encourages people to punt too easily. The foreach construct still had some difficulty with two nested foreach loops referring to the same array, and to a single foreach that called its enclosing subroutine recursively. I think I've got this straight now. You wouldn't think a little iterator would give some much trouble. A pattern like /b*/ wouldn't match a null string before the first character. And certain patterns didn't match correctly at end of string. The upshot was that $_ = 'aaa'; s/b*/x/g; produced 'axaxa' rather than the expected 'xaxaxax'. This has been fixed. Note however that the split operator will still not match a null string before the first character, so that split(/b*/,'aaa') produces ('a','a','a'), not ('','a','a','a',''). The saga continues, and hopefully concludes. I realized I was fighting a losing battle trying to grep out all the includes from and . There are just too many funny includes, symbols, links and such on too many kinds of machines. Configure now compiles a test program several different ways to figure out which way to define the various symbols. Configure now lets you pick between yacc or bison for your compiler compiler. If you pick bison, be sure you have alloca somewhere on your system. The ANSI function strerror() is now supported where available. In addition, errno may now be a macro with an lvalue, so errno isn't declared extern if it's defined as a macro in . The memcpy() and memset() are now allowed to return void. There is now support for sys/ndir.h for systems such as Xenix. It's now also easier to cross compile on a 386 for a 286. DG/UX has functions setpgrp2() and getpgrp2() to keep the BSD sematics separate from the SystemV semantics. So now we have yet another wonderful non-standard way of doing things. There is also a utime.h file which lets them put time stamps on files to microsecond resolutions, though perl doesn't take advantage of this. The list of optional libraries to be searched for now includes -lnet_s, -lnsl_s, -lsocket and -lx. We can now find .h files down in /usr/include/lan. Microport systems have problems. I've added some CRIPPLED_CC support for them, but you still need to read the README.uport file for some extra rigamarole. In the README file, there are now hints for what to do if your compile doesn't work right, and specific hints for machines known to require certain switches. The grep operator with a simple first argument, such as grep(1,@array), didn't work right. That one seems silly, but grep($_,@array) didn't work either. Now it does. A /$pat/ followed by a // wrongly freed the runtime pattern twice, causing ill-will on the part of all concerned. The ord() function now always returns positive even on signed-char machines. This seems to be less surprising to people. If you still want a signed value on such machines, you can always use unpack. The lib/complete.pl file misused the @_ array. The array has been renamed. In the man page, I clarified that s`pat`repl` does command substitution on the replacement string, that $timeleft from select() is likely not implemented in many places, and that the qualified form package'filehandle works as well as $package'variable. It is also explicitly stated that certain identifiers (non-alpha, STDIN, etc.) are always resolved in package main's symbol table. Perl didn't grok setuid scripts that had a space on the first line between the shebang and the interpreter name. In stab.c, sighandler() may now return either void or int, depending on the value of VOIDSIG. You couldn't debug a script that used -p or -n because they would try to slap an extra } on the end of the perldb.pl file. This upset the parser. The interpration of strings like " ''$foo'' " caused problems because the tokener didn't realize that neither single quote following the variable was indicating a package qualifier. (It knew the last one wasn't, but was confused about the first one.) Merely changing an if to a while fixed it. Well, two if's. Another place we don't want ' to be interpreted as a package qualifier is if it's the delimiter for an m'pat' or s'pat'repl'. These have been grandfathered to look like a match and a substitution. There were a couple of problems in a2p. First, the ops array was dimensioned too big on 286's. Second, there was a problem involving passing a union where I should've passed a member of the union, which meant user-defined functions didn't work right on some machines. Fix: From rn, say "| patch -p -N -d DIR", where DIR is your perl source directory. Outside of rn, say "cd DIR; patch -p -N #define PATCHLEVEL 7 Index: Configure Prereq: 3.0.1.3 *** Configure.old Thu Dec 21 20:35:01 1989 --- Configure Thu Dec 21 20:35:07 1989 *************** *** 8,14 **** # 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.1.3 89/11/17 15:01:21 lwall Locked $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than --- 8,14 ---- # 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.1.4 89/12/21 18:57:00 lwall Locked $ # # Yes, you may rip this off to use in other distribution packages. # (Note: this Configure script was generated automatically. Rather than *************** *** 115,120 **** --- 115,121 ---- d_getgrps='' d_gethent='' d_getpgrp='' + d_getpgrp2='' d_getprior='' d_htonl='' d_index='' *************** *** 132,137 **** --- 133,139 ---- d_setegid='' d_seteuid='' d_setpgrp='' + d_setpgrp2='' d_setprior='' d_setregid='' d_setresgid='' *************** *** 146,157 **** d_statblks='' d_stdstdio='' d_strctcpy='' d_symlink='' d_syscall='' - d_tminsys='' - i_systime='' - i_timetoo='' - i_systimetoo='' d_varargs='' d_vfork='' d_voidsig='' --- 148,156 ---- d_statblks='' d_stdstdio='' d_strctcpy='' + d_strerror='' d_symlink='' d_syscall='' d_varargs='' d_vfork='' d_voidsig='' *************** *** 172,177 **** --- 171,181 ---- d_pwexpire='' i_sysdir='' i_sysioctl='' + i_sysndir='' + i_time='' + i_systime='' + d_systimekernel='' + i_utime='' i_varargs='' i_vfork='' intsize='' *************** *** 206,213 **** uidtype='' voidflags='' defvoidused='' ! lib='' privlib='' CONFIG='' : set package name package=perl --- 210,218 ---- uidtype='' voidflags='' defvoidused='' ! yacc='' privlib='' + lib='' CONFIG='' : set package name package=perl *************** *** 219,225 **** define='define' undef='undef' ! libpth='/usr/lib /usr/local/lib /usr/lib/386 /usr/lib/large /lib /lib/386 /lib/large /usr/lib/small /lib/small' smallmach='pdp11 i8086 z8000 i80286 iAPX286' rmlist='kit[1-9]isdone kit[1-9][0-9]isdone' trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3 --- 224,232 ---- define='define' undef='undef' ! : change the next line if compiling for Xenix/286 on Xenix/386 ! xlibpth='/usr/lib/386 /lib/386' ! libpth='/usr/lib /usr/local/lib /usr/lib/large /lib '$xlibpth' /lib/large /usr/lib/small /lib/small' smallmach='pdp11 i8086 z8000 i80286 iAPX286' rmlist='kit[1-9]isdone kit[1-9][0-9]isdone' trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3 *************** *** 245,256 **** attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc" attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX" attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386" ! attrlist="$attrlist i186" pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb" d_newshome="/usr/NeWS" defvoidused=7 ! libswanted="net nm ndir ndbm dbm sun bsd c_s" ! inclwanted='/usr/netinclude /usr/include/sun /usr/include/bsd' : some greps do not return status, grrr. echo "grimblepritz" >grimble if grep blurfldyick grimble >/dev/null 2>&1 ; then --- 252,263 ---- attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc" attrlist="$attrlist nsc32000 sinix xenix venix posix ansi M_XENIX" attrlist="$attrlist $mc68k __STDC__ UTS M_I8086 M_I186 M_I286 M_I386" ! attrlist="$attrlist i186 __m88k__ m88k DGUX __DGUX__" pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /usr/plx /usr/5bin /vol/local/bin /etc /usr/lib /lib /usr/local/lib /sys5.3/bin /sys5.3/usr/bin /bsd4.3/bin /bsd4.3/usr/bin /bsd4.3/usr/ucb" d_newshome="/usr/NeWS" defvoidused=7 ! libswanted="net_s net nsl_s nsl socket nm ndir ndbm dbm sun bsd x c_s" ! inclwanted='/usr/netinclude /usr/include/sun /usr/include/bsd /usr/include/lan' : some greps do not return status, grrr. echo "grimblepritz" >grimble if grep blurfldyick grimble >/dev/null 2>&1 ; then *************** *** 1104,1114 **** '') libswanted='c_s';; esac for thislib in $libswanted; do xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib` if test -f $xxx; then echo "Found -l$thislib." case "$dflt" in ! *-l$thislib*);; *) dflt="$dflt -l$thislib";; esac else --- 1111,1127 ---- '') libswanted='c_s';; esac for thislib in $libswanted; do + case "$thislib" in + dbm) thatlib=ndbm;; + *_s) thatlib=NONE;; + *) thatlib="${thislib}_s";; + *) thatlib=NONE;; + esac xxx=`loc lib$thislib.a X /usr/lib /usr/local/lib /lib` if test -f $xxx; then echo "Found -l$thislib." case "$dflt" in ! *-l$thislib*|*-l$thatlib*);; *) dflt="$dflt -l$thislib";; esac else *************** *** 1120,1130 **** *) dflt="$dflt $xxx";; esac else ! xxx=`loc Slib$thislib.a X /usr/lib /usr/local/lib /lib` if test -f $xxx; then echo "Found -l$thislib." case "$dflt" in ! *-l$thislib*);; *) dflt="$dflt -l$thislib";; esac else --- 1133,1143 ---- *) dflt="$dflt $xxx";; esac else ! xxx=`loc Slib$thislib.a X $xlibpth` if test -f $xxx; then echo "Found -l$thislib." case "$dflt" in ! *-l$thislib*|*-l$thatlib*);; *) dflt="$dflt -l$thislib";; esac else *************** *** 1151,1156 **** --- 1164,1170 ---- by default. There may be other libraries needed to compile $package on your machine as well. If your system needs the "-lc_s" option, include it here. Include any other special libraries here as well. + Say "none" for none. EOM echo " " *************** *** 1347,1353 **** if test ! -f $try; then try=`loc $thislib blurfl/dyick $libpth` if test ! -f $try; then ! try='' fi fi fi --- 1361,1370 ---- if test ! -f $try; then try=`loc $thislib blurfl/dyick $libpth` if test ! -f $try; then ! try=`loc Slib$thislib.a blurfl/dyick $xlibpth` ! if test ! -f $try; then ! try='' ! fi fi fi fi *************** *** 1377,1389 **** ans=`loc clib blurfl/dyick $libpth` fi if test ! -f "$ans"; then ! ans=`loc Slibc.a blurfl/dyick /usr/lib/386 /lib/386 $libpth` fi if test ! -f "$ans"; then ! ans=`loc Mlibc.a blurfl/dyick $libpth` fi if test ! -f "$ans"; then ! ans=`loc Llibc.a blurfl/dyick $libpth` fi if test -f "$ans"; then echo "Your C library is in $ans, of all places." --- 1394,1406 ---- ans=`loc clib blurfl/dyick $libpth` fi if test ! -f "$ans"; then ! ans=`loc Slibc.a blurfl/dyick $xlibpth` fi if test ! -f "$ans"; then ! ans=`loc Mlibc.a blurfl/dyick $xlibpth` fi if test ! -f "$ans"; then ! ans=`loc Llibc.a blurfl/dyick $xlibpth` fi if test -f "$ans"; then echo "Your C library is in $ans, of all places." *************** *** 1522,1535 **** d_crypt="$define" cryptlib='' else ! cryptlib=`loc Slibcrypt.a "" /lib/386 /lib` if $test -z "$cryptlib"; then ! cryptlib=`loc Mlibcrypt.a "" /lib/386 /lib` else cryptlib=-lcrypt fi if $test -z "$cryptlib"; then ! cryptlib=`loc Llibcrypt.a "" /lib/386 /lib` else cryptlib=-lcrypt fi --- 1539,1552 ---- d_crypt="$define" cryptlib='' else ! cryptlib=`loc Slibcrypt.a "" $xlibpth` if $test -z "$cryptlib"; then ! cryptlib=`loc Mlibcrypt.a "" $xlibpth` else cryptlib=-lcrypt fi if $test -z "$cryptlib"; then ! cryptlib=`loc Llibcrypt.a "" $xlibpth` else cryptlib=-lcrypt fi *************** *** 1636,1641 **** --- 1653,1662 ---- set getpgrp d_getpgrp eval $inlibc + : see if getpgrp2 exists + set getpgrp2 d_getpgrp2 + eval $inlibc + : see if getpriority exists set getpriority d_getprior eval $inlibc *************** *** 1792,1797 **** --- 1813,1822 ---- set setpgrp d_setpgrp eval $inlibc + : see if setpgrp2 exists + set setpgrp2 d_setpgrp2 + eval $inlibc + : see if setpriority exists set setpriority d_setprior eval $inlibc *************** *** 1923,1928 **** --- 1948,1957 ---- fi $rm -f try.* + : see if strerror exists + set strerror d_strerror + eval $inlibc + : see if symlink exists set symlink d_symlink eval $inlibc *************** *** 1931,1961 **** set syscall d_syscall eval $inlibc ! : see if struct tm is defined in sys/time.h ! echo " " ! if $contains 'struct tm' /usr/include/time.h >/dev/null 2>&1 ; then ! echo "You have struct tm defined in rather than ." ! d_tminsys="$undef" ! if test -f /usr/include/sys/time.h; then ! i_systime="$define" ! else ! i_systime="$undef" ! fi ! else ! echo "You have struct tm defined in rather than ." ! d_tminsys="$define" ! i_systime="$define" ! fi ! if $contains '^#.*include.*' /usr/include/sys/time.h >/dev/null 2>&1 ; then ! i_timetoo="$undef" ! else ! i_timetoo="$define" ! fi ! if $contains '^#.*include.*' /usr/include/time.h >/dev/null 2>&1 ; then ! i_systimetoo="$undef" ! else ! i_systimetoo="$define" ! fi : see if this is a varargs system echo " " --- 1960,2030 ---- set syscall d_syscall eval $inlibc ! : see if we should include time.h, sys/time.h, or both ! cat <<'EOM' ! ! Testing to see if we should include , or both. ! I'm now running the test program... ! EOM ! $cat >try.c <<'EOCP' ! #ifdef I_TIME ! #include ! #endif ! #ifdef I_SYSTIME ! #ifdef SYSTIMEKERNEL ! #define KERNEL ! #endif ! #include ! #endif ! main() ! { ! struct tm foo; ! #ifdef S_TIMEVAL ! struct timeval bar; ! #endif ! if (foo.tm_sec == foo.tm_sec) ! exit(0); ! #ifdef S_TIMEVAL ! if (bar.tv_sec == bar.tv_sec) ! exit(0); ! #endif ! exit(1); ! } ! EOCP ! flags='' ! for s_timeval in '-DS_TIMEVAL' ''; do ! for d_systimekernel in '' '-DSYSTIMEKERNEL'; do ! for i_time in '' '-DI_TIME'; do ! for i_systime in '-DI_SYSTIME' ''; do ! case "$flags" in ! '') echo Trying $i_time $i_systime $d_systimekernel $s_timeval ! if $cc try.c $ccflags \ ! $i_time $i_systime $d_systimekernel $s_timeval \ ! -o try >/dev/null 2>&1 ; then ! set X $i_time $i_systime $d_systimekernel $s_timeval ! shift ! flags="$*" ! echo Succeeded with $flags ! fi ! ;; ! esac ! done ! done ! done ! done ! case "$flags" in ! *SYSTIMEKERNEL*) d_systimekernel="$define";; ! *) d_systimekernel="$undef";; ! esac ! case "$flags" in ! *I_TIME*) i_time="$define";; ! *) i_time="$undef";; ! esac ! case "$flags" in ! *I_SYSTIME*) i_systime="$define";; ! *) i_systime="$undef";; ! esac ! $rm -f try.c try : see if this is a varargs system echo " " *************** *** 2120,2129 **** echo " " if $test -r /usr/include/sys/dir.h ; then i_sysdir="$define" ! echo "sysdir.h found." else i_sysdir="$undef" ! echo "No sysdir.h found." fi : see if ioctl defs are in sgtty/termio or sys/ioctl --- 2189,2198 ---- echo " " if $test -r /usr/include/sys/dir.h ; then i_sysdir="$define" ! echo "sys/dir.h found." else i_sysdir="$undef" ! echo "No sys/dir.h found." fi : see if ioctl defs are in sgtty/termio or sys/ioctl *************** *** 2136,2141 **** --- 2205,2231 ---- echo "sys/ioctl.h not found, assuming ioctl args are defined in sgtty.h." fi + : see if this is a sys/ndir.h system + echo " " + xxx=`loc sys/ndir.h x /usr/include /usr/local/include $inclwanted` + if test -f $xxx; then + i_sysndir="$define" + echo "sys/ndir.h found." + else + i_sysndir="$undef" + echo "No sys/ndir.h found." + fi + + : see if this is DG/UX with a funky utime.h + echo " " + if $test -r /usr/include/utime.h ; then + i_utime="$define" + echo "utime.h found." + else + i_utime="$undef" + echo "No utime.h found, but that's ok." + fi + : see if this is a varargs system echo " " if $test -r /usr/include/varargs.h ; then *************** *** 2347,2352 **** --- 2437,2457 ---- *) mallocsrc=''; mallocobj='';; esac + : determine compiler compiler + case "$yacc" in + '') dflt=yacc;; + *) dflt="$yacc";; + esac + cont=true + echo " " + rp="Which compiler compiler (yacc or bison) will you use? [$dflt]" + $echo $n "$rp $c" + . myread + case "$ans" in + '') ans="$dflt";; + esac + yacc="$ans" + echo " " echo "End of configuration questions." echo " " *************** *** 2439,2444 **** --- 2544,2550 ---- d_getgrps='$d_getgrps' d_gethent='$d_gethent' d_getpgrp='$d_getpgrp' + d_getpgrp2='$d_getpgrp2' d_getprior='$d_getprior' d_htonl='$d_htonl' d_index='$d_index' *************** *** 2456,2461 **** --- 2562,2568 ---- d_setegid='$d_setegid' d_seteuid='$d_seteuid' d_setpgrp='$d_setpgrp' + d_setpgrp2='$d_setpgrp2' d_setprior='$d_setprior' d_setregid='$d_setregid' d_setresgid='$d_setresgid' *************** *** 2470,2481 **** d_statblks='$d_statblks' d_stdstdio='$d_stdstdio' d_strctcpy='$d_strctcpy' d_symlink='$d_symlink' d_syscall='$d_syscall' - d_tminsys='$d_tminsys' - i_systime='$i_systime' - i_timetoo='$i_timetoo' - i_systimetoo='$i_systimetoo' d_varargs='$d_varargs' d_vfork='$d_vfork' d_voidsig='$d_voidsig' --- 2577,2585 ---- d_statblks='$d_statblks' d_stdstdio='$d_stdstdio' d_strctcpy='$d_strctcpy' + d_strerror='$d_strerror' d_symlink='$d_symlink' d_syscall='$d_syscall' d_varargs='$d_varargs' d_vfork='$d_vfork' d_voidsig='$d_voidsig' *************** *** 2496,2501 **** --- 2600,2610 ---- d_pwexpire='$d_pwexpire' i_sysdir='$i_sysdir' i_sysioctl='$i_sysioctl' + i_sysndir='$i_sysndir' + i_time='$i_time' + i_systime='$i_systime' + d_systimekernel='$d_systimekernel' + i_utime='$i_utime' i_varargs='$i_varargs' i_vfork='$i_vfork' intsize='$intsize' *************** *** 2530,2537 **** uidtype='$uidtype' voidflags='$voidflags' defvoidused='$defvoidused' ! lib='$lib' privlib='$privlib' CONFIG=true EOT --- 2639,2647 ---- uidtype='$uidtype' voidflags='$voidflags' defvoidused='$defvoidused' ! yacc='$yacc' privlib='$privlib' + lib='$lib' CONFIG=true EOT *************** *** 2549,2554 **** --- 2659,2665 ---- *) : in case they cannot read eval $ans;; esac + : if this fails, just run all the .SH files by hand . ./config.sh echo " " Index: MANIFEST *** MANIFEST.old Thu Dec 21 20:32:56 1989 --- MANIFEST Thu Dec 21 20:32:57 1989 *************** *** 7,12 **** --- 7,13 ---- Makefile.SH Precursor to Makefile PACKINGLIST Which files came from which kits README The Instructions + README.uport Special instructions for Microports Wishlist Some things that may or may not happen arg.h Public declarations for the above array.c Numerically subscripted arrays Index: Makefile.SH Prereq: 3.0.1.2 *** Makefile.SH.old Thu Dec 21 20:33:02 1989 --- Makefile.SH Thu Dec 21 20:33:04 1989 *************** *** 25,33 **** echo "Extracting Makefile (with variable substitutions)" cat >Makefile <Makefile <.shlist # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE ! perly.o $(obj): @ echo "You haven't done a "'"make depend" yet!'; exit 1 makedepend: makedepend.SH /bin/sh makedepend.SH --- 346,352 ---- echo $(sh) | tr ' ' '\012' >.shlist # AUTOMATICALLY GENERATED MAKE DEPENDENCIES--PUT NOTHING BELOW THIS LINE ! $(obj): @ echo "You haven't done a "'"make depend" yet!'; exit 1 makedepend: makedepend.SH /bin/sh makedepend.SH Index: x2p/Makefile.SH Prereq: 3.0.1.2 *** x2p/Makefile.SH.old Thu Dec 21 20:38:10 1989 --- x2p/Makefile.SH Thu Dec 21 20:38:11 1989 *************** *** 18,28 **** esac echo "Extracting x2p/Makefile (with variable substitutions)" cat >Makefile <Makefile < #include --- 216,231 ---- EXT int mop INIT(1); ! union u_ops { int ival; char *cval; ! }; ! #if defined(iAPX286) || defined(M_I286) || defined(I80286) /* 80286 hack */ ! #define OPSMAX (64000/sizeof(union u_ops)) /* approx. max segment size */ ! #else ! #define OPSMAX 50000 ! #endif /* 80286 hack */ ! union u_ops ops[OPSMAX]; #include #include Index: arg.h Prereq: 3.0.1.1 *** arg.h.old Thu Dec 21 20:33:19 1989 --- arg.h Thu Dec 21 20:33:21 1989 *************** *** 1,4 **** ! /* $Header: arg.h,v 3.0.1.1 89/10/26 23:02:35 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $Header: arg.h,v 3.0.1.2 89/12/21 19:13:14 lwall Locked $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,14 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: arg.h,v $ + * Revision 3.0.1.2 89/12/21 19:13:14 lwall + * patch7: send() didn't allow a TO argument + * * Revision 3.0.1.1 89/10/26 23:02:35 lwall * patch1: reverse didn't work * *************** *** 815,821 **** A(1,1,0), /* CONNECT */ A(1,1,0), /* LISTEN */ A(1,1,0), /* ACCEPT */ ! A(1,1,2), /* SEND */ A(1,1,1), /* RECV */ A(1,1,1), /* SSELECT */ A(1,1,1), /* SOCKETPAIR */ --- 818,824 ---- A(1,1,0), /* CONNECT */ A(1,1,0), /* LISTEN */ A(1,1,0), /* ACCEPT */ ! A(1,1,3), /* SEND */ A(1,1,1), /* RECV */ A(1,1,1), /* SSELECT */ A(1,1,1), /* SOCKETPAIR */ Index: cmd.c Prereq: 3.0.1.3 *** cmd.c.old Thu Dec 21 20:33:30 1989 --- cmd.c Thu Dec 21 20:33:35 1989 *************** *** 1,4 **** ! /* $Header: cmd.c,v 3.0.1.3 89/11/17 15:04:36 lwall Locked $ * * Copyright (c) 1989, Larry Wall * --- 1,4 ---- ! /* $Header: cmd.c,v 3.0.1.4 89/12/21 19:17:41 lwall Locked $ * * Copyright (c) 1989, Larry Wall * *************** *** 6,11 **** --- 6,15 ---- * as specified in the README file that comes with the perl 3.0 kit. * * $Log: cmd.c,v $ + * Revision 3.0.1.4 89/12/21 19:17:41 lwall + * patch7: arranged for certain registers to be restored after longjmp() + * patch7: made nested or recursive foreach work right + * * Revision 3.0.1.3 89/11/17 15:04:36 lwall * patch5: nested foreach on same array didn't work * *************** *** 32,37 **** --- 36,47 ---- void grow_dlevel(); + /* do longjmps() clobber register variables? */ + + #if defined(cray) || defined(__STDC__) + #define JMPCLOBBER + #endif + /* This is the main command loop. We try to spend as much time in this loop * as possible, so lots of optimizations do their activities in here. This * means things get a little sloppy. *************** *** 38,58 **** */ int ! cmd_exec(cmd,gimme,sp) ! #ifdef cray /* nobody else has complained yet */ ! CMD *cmd; ! #else ! register CMD *cmd; ! #endif int gimme; int sp; { ! SPAT *oldspat; ! int oldsave; ! int aryoptsave; #ifdef DEBUGGING ! int olddlevel; ! int entdlevel; #endif register STR *retstr = &str_undef; register char *tmps; --- 48,65 ---- */ int ! cmd_exec(cmdparm,gimme,sp) ! CMD *VOLATILE cmdparm; int gimme; int sp; { ! register CMD *cmd = cmdparm; ! SPAT *VOLATILE oldspat; ! VOLATILE int oldsave; ! VOLATILE int aryoptsave; #ifdef DEBUGGING ! VOLATILE int olddlevel; ! VOLATILE int entdlevel; #endif register STR *retstr = &str_undef; register char *tmps; *************** *** 61,68 **** register char *go_to = goto_targ; register int newsp = -2; register STR **st = stack->ary_array; ! FILE *fp; ! ARRAY *ar; lastsize = 0; #ifdef DEBUGGING --- 68,75 ---- register char *go_to = goto_targ; register int newsp = -2; register STR **st = stack->ary_array; ! VOLATILE FILE *fp; ! VOLATILE ARRAY *ar; lastsize = 0; #ifdef DEBUGGING *************** *** 167,197 **** } #endif } ! switch (setjmp(loop_stack[loop_ptr].loop_env)) { ! case O_LAST: /* not done unless go_to found */ ! go_to = Nullch; st = stack->ary_array; /* possibly reallocated */ ! if (lastretstr) { ! retstr = lastretstr; ! newsp = -2; ! } ! else { ! newsp = sp + lastsize; ! retstr = st[newsp]; ! } #ifdef DEBUGGING ! olddlevel = dlevel; #endif ! curspat = oldspat; ! if (savestack->ary_fill > oldsave) ! restorelist(oldsave); ! goto next_cmd; ! case O_NEXT: /* not done unless go_to found */ ! go_to = Nullch; ! goto next_iter; ! case O_REDO: /* not done unless go_to found */ ! go_to = Nullch; ! goto doit; } oldspat = curspat; oldsave = savestack->ary_fill; --- 174,221 ---- } #endif } ! #ifdef JMPCLOBBER ! cmdparm = cmd; ! #endif ! if (match = setjmp(loop_stack[loop_ptr].loop_env)) { ! #ifdef JMPCLOBBER st = stack->ary_array; /* possibly reallocated */ ! cmd = cmdparm; ! cmdflags = cmd->c_flags|CF_ONCE; ! #endif ! switch (match) { ! case O_LAST: /* not done unless go_to found */ ! go_to = Nullch; ! if (lastretstr) { ! retstr = lastretstr; ! newsp = -2; ! } ! else { ! newsp = sp + lastsize; ! retstr = st[newsp]; ! } #ifdef DEBUGGING ! olddlevel = dlevel; #endif ! curspat = oldspat; ! if (savestack->ary_fill > oldsave) ! restorelist(oldsave); ! goto next_cmd; ! case O_NEXT: /* not done unless go_to found */ ! go_to = Nullch; ! #ifdef JMPCLOBBER ! newsp = -2; ! retstr = &str_undef; ! #endif ! goto next_iter; ! case O_REDO: /* not done unless go_to found */ ! go_to = Nullch; ! #ifdef JMPCLOBBER ! newsp = -2; ! retstr = &str_undef; ! #endif ! goto doit; ! } } oldspat = curspat; oldsave = savestack->ary_fill; *************** *** 572,578 **** newsp = eval(cmd->c_expr,gimme && (cmdflags & CF_TERM),sp); st = stack->ary_array; /* possibly reallocated */ retstr = st[newsp]; ! if (newsp > sp) match = str_true(retstr); else match = FALSE; --- 596,602 ---- newsp = eval(cmd->c_expr,gimme && (cmdflags & CF_TERM),sp); st = stack->ary_array; /* possibly reallocated */ retstr = st[newsp]; ! if (newsp > sp && retstr) match = str_true(retstr); else match = FALSE; *************** *** 725,753 **** } #endif } ! switch (setjmp(loop_stack[loop_ptr].loop_env)) { ! case O_LAST: ! /* retstr = lastretstr; */ st = stack->ary_array; /* possibly reallocated */ ! if (lastretstr) { ! retstr = lastretstr; newsp = -2; ! } ! else { ! newsp = sp + lastsize; ! retstr = st[newsp]; ! } ! curspat = oldspat; ! if (savestack->ary_fill > oldsave) ! restorelist(oldsave); ! goto next_cmd; ! case O_NEXT: ! goto next_iter; ! case O_REDO: #ifdef DEBUGGING ! dlevel = olddlevel; #endif ! goto doit; } oldspat = curspat; oldsave = savestack->ary_fill; --- 749,794 ---- } #endif } ! #ifdef JMPCLOBBER ! cmdparm = cmd; ! #endif ! if (match = setjmp(loop_stack[loop_ptr].loop_env)) { ! #ifdef JMPCLOBBER st = stack->ary_array; /* possibly reallocated */ ! cmd = cmdparm; ! cmdflags = cmd->c_flags|CF_ONCE; ! go_to = goto_targ; ! #endif ! switch (match) { ! case O_LAST: ! if (lastretstr) { ! retstr = lastretstr; ! newsp = -2; ! } ! else { ! newsp = sp + lastsize; ! retstr = st[newsp]; ! } ! curspat = oldspat; ! if (savestack->ary_fill > oldsave) ! restorelist(oldsave); ! goto next_cmd; ! case O_NEXT: ! #ifdef JMPCLOBBER newsp = -2; ! retstr = &str_undef; ! #endif ! goto next_iter; ! case O_REDO: #ifdef DEBUGGING ! dlevel = olddlevel; #endif ! #ifdef JMPCLOBBER ! newsp = -2; ! retstr = &str_undef; ! #endif ! goto doit; ! } } oldspat = curspat; oldsave = savestack->ary_fill; *************** *** 1010,1015 **** --- 1051,1057 ---- str = Str_new(18,0); str_sset(str,sarg[i]); (void)apush(savestack,str); /* remember the value */ + sarg[i]->str_u.str_useful = -1; } } Index: lib/complete.pl *** lib/complete.pl.old Thu Dec 21 20:35:43 1989 --- lib/complete.pl Thu Dec 21 20:35:44 1989 *************** *** 24,30 **** sub Complete { local ($prompt) = shift (@_); local ($c, $cmp, $l, $r, $ret, $return, $test); ! @_ = sort @_; system 'stty raw -echo'; loop: { print $prompt, $return; --- 24,30 ---- sub Complete { local ($prompt) = shift (@_); local ($c, $cmp, $l, $r, $ret, $return, $test); ! @_cmp_lst = sort @_; system 'stty raw -echo'; loop: { print $prompt, $return; *************** *** 31,37 **** while (($c = getc(stdin)) ne "\r") { if ($c eq "\t") { # (TAB) attempt completion @_match = (); ! foreach $cmp (@_) { push (@_match, $cmp) if $cmp =~ /^$return/; } $test = $_match[0]; --- 31,37 ---- while (($c = getc(stdin)) ne "\r") { if ($c eq "\t") { # (TAB) attempt completion @_match = (); ! foreach $cmp (@_cmp_lst) { push (@_match, $cmp) if $cmp =~ /^$return/; } $test = $_match[0]; *************** *** 50,56 **** } elsif ($c eq "\004") { # (^D) completion list print "\r\n"; ! foreach $cmp (@_) { print "$cmp\r\n" if $cmp =~ /^$return/; } redo loop; --- 50,56 ---- } elsif ($c eq "\004") { # (^D) completion list print "\r\n"; ! foreach $cmp (@_cmp_lst) { print "$cmp\r\n" if $cmp =~ /^$return/; } redo loop; Index: config.h.SH *** config.h.SH.old Thu Dec 21 20:33:41 1989 --- config.h.SH Thu Dec 21 20:33:43 1989 *************** *** 167,172 **** --- 167,178 ---- */ #$d_getpgrp GETPGRP /**/ + /* GETPGRP2: + * This symbol, if defined, indicates that the getpgrp2() (as in DG/UX) + * routine is available to get the current process group. + */ + #$d_getpgrp2 GETPGRP2 /**/ + /* GETPRIORITY: * This symbol, if defined, indicates that the getpriority() routine is * available to get a process's priority. *************** *** 294,299 **** --- 300,311 ---- */ #$d_setpgrp SETPGRP /**/ + /* SETPGRP2: + * This symbol, if defined, indicates that the setpgrp2() (as in DG/UX) + * routine is available to set the current process group. + */ + #$d_setpgrp2 SETPGRP2 /**/ + /* SETPRIORITY: * This symbol, if defined, indicates that the setpriority() routine is * available to set a process's priority. *************** *** 373,378 **** --- 385,396 ---- */ #$d_strctcpy STRUCTCOPY /**/ + /* STRERROR: + * This symbol, if defined, indicates that the strerror() routine is + * available to translate error numbers to strings. + */ + #$d_strerror STRERROR /**/ + /* SYMLINK: * This symbol, if defined, indicates that the symlink routine is available * to create symbolic links. *************** *** 385,412 **** */ #$d_syscall SYSCALL /**/ - /* TMINSYS: - * This symbol is defined if this system declares "struct tm" in - * in rather than . We can't just say - * -I/usr/include/sys because some systems have both time files, and - * the -I trick gets the wrong one. - */ - /* I_SYSTIME: - * This symbol is defined if this system has the file . - */ - /* I_TIMETOO: - * This symbol is defined if exists but doesn't include - * . - */ - /* I_SYSTIMETOO: - * This symbol is defined if exists but isn't included - * by . - */ - #$d_tminsys TMINSYS /**/ - #$i_systime I_SYSTIME /**/ - #$i_timetoo I_TIMETOO /**/ - #$i_systimetoo I_SYSTIMETOO /**/ - /* VARARGS: * This symbol, if defined, indicates to the C program that it should * include varargs.h. --- 403,408 ---- *************** *** 523,528 **** --- 519,550 ---- * be included. */ #$i_sysioctl I_SYSIOCTL /**/ + + /* I_SYSNDIR: + * This symbol, if defined, indicates to the C program that it should + * include sys/ndir.h. + */ + #$i_sysndir I_SYSNDIR /**/ + + /* I_TIME: + * This symbol is defined if the program should include . + */ + /* I_SYSTIME: + * This symbol is defined if the program should include . + */ + /* I_SYSTIMEKERNEL: + * This symbol is defined if the program should include + * with KERNEL defined. + */ + #$i_time I_TIME /**/ + #$i_systime I_SYSTIME /**/ + #$d_systimekernel SYSTIMEKERNEL /**/ + + /* I_UTIME: + * This symbol, if defined, indicates to the C program that it should + * include utime.h (a DG/UX thingie). + */ + #$i_utime I_UTIME /**/ /* I_VARARGS: * This symbol, if defined, indicates to the C program that it should