perl 3.0 patch #7 (REPOST)

Larry Wall lwall at jpl-devvax.JPL.NASA.GOV
Thu Jan 18 10:10:43 AEST 1990


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, at 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 <time.h> and <sys/time.h>.  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 <errno.h>.
	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, at array),
	didn't work right.  That one seems silly, but grep($_, at 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 <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch (version 2.0, latest patchlevel).

	After patching:
		*** DO NOTHING--APPLY PATCH 8 BEFORE RECOMPILING ***

	If patch indicates that patchlevel is the wrong version, you may need
	to apply one or more previous patches, or the patch may already
	have been applied.  See the patchlevel.h file to find out what has or
	has not been applied.  In any event, don't continue with the patch.

	If you are missing previous patches they can be obtained from me:

	Larry Wall
	lwall at jpl-devvax.jpl.nasa.gov

	If you send a mail message of the following form it will greatly speed
	processing:

	Subject: Command
	@SH mailpatch PATH perl 3.0 LIST
		   ^ note the c

	where PATH is a return path FROM ME TO YOU either in Internet notation,
	or in bang notation from some well-known host, and LIST is the number
	of one or more patches you need, separated by spaces, commas, and/or
	hyphens.  Saying 35- says everything from 35 to the end.


	You can also get the patches via anonymous FTP from
	jpl-devvax.jpl.nasa.gov (128.149.1.143).

Index: patchlevel.h
Prereq: 6
1c1
< #define PATCHLEVEL 6
---
> #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 <time.h> rather than <sys/time.h>."
!     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 <sys/time.h> rather than <time.h>."
!     d_tminsys="$define"
!     i_systime="$define"
! fi
! if $contains '^#.*include.*<time\.h>' /usr/include/sys/time.h >/dev/null 2>&1 ; then
!     i_timetoo="$undef"
! else
!     i_timetoo="$define"
! fi
! if $contains '^#.*include.*<sys/time\.h>' /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 <time.h>, <sys/time.h> or both.
! I'm now running the test program...
! EOM
! $cat >try.c <<'EOCP'
! #ifdef I_TIME
! #include <time.h>
! #endif
! #ifdef I_SYSTIME
! #ifdef SYSTIMEKERNEL
! #define KERNEL
! #endif
! #include <sys/time.h>
! #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 <<!GROK!THIS!
! # $Header: Makefile.SH,v 3.0.1.2 89/11/11 04:07:30 lwall Locked $
  #
  # $Log:	Makefile.SH,v $
  # Revision 3.0.1.2  89/11/11  04:07:30  lwall
  # patch2: $sockethdr incorporated into $ccflags
  # patch2: $libs now has most of the -l libraries
--- 25,36 ----
  
  echo "Extracting Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 3.0.1.3 89/12/21 19:09:26 lwall Locked $
  #
  # $Log:	Makefile.SH,v $
+ # Revision 3.0.1.3  89/12/21  19:09:26  lwall
+ # patch7: Configure now lets you pick between yacc or bison
+ # 
  # Revision 3.0.1.2  89/11/11  04:07:30  lwall
  # patch2: $sockethdr incorporated into $ccflags
  # patch2: $libs now has most of the -l libraries
***************
*** 40,45 ****
--- 43,49 ----
  # 
  
  CC = $cc
+ YACC = $yacc
  bin = $bin
  privlib = $privlib
  mansrc = $mansrc
***************
*** 102,113 ****
  .c.o:
  	$(CC) -c $(CFLAGS) $(LARGE) $*.c
  
! all: $(public) $(private) $(util) perl.man x2p/all
  	touch all
  
- x2p/all:
- 	cd x2p; $(MAKE) all
- 
  # This is the standard version that contains no "taint" checks and is
  # used for all scripts that aren't set-id or running under something set-id.
  
--- 106,115 ----
  .c.o:
  	$(CC) -c $(CFLAGS) $(LARGE) $*.c
  
! all: $(public) $(private) $(util) perl.man
! 	cd x2p; $(MAKE) all
  	touch all
  
  # This is the standard version that contains no "taint" checks and is
  # used for all scripts that aren't set-id or running under something set-id.
  
***************
*** 254,260 ****
  
  perl.c perly.h: perl.y
  	@ echo Expect 25 shift/reduce errors...
! 	yacc -d perl.y
  	mv y.tab.c perl.c
  	mv y.tab.h perly.h
  
--- 256,262 ----
  
  perl.c perly.h: perl.y
  	@ echo Expect 25 shift/reduce errors...
! 	$(YACC) -d perl.y
  	mv y.tab.c perl.c
  	mv y.tab.h perly.h
  
***************
*** 307,313 ****
  	cd x2p; $(MAKE) install
  
  clean:
! 	rm -f *.o all perl taintperl perl.man
  	cd x2p; $(MAKE) clean
  
  realclean:
--- 309,315 ----
  	cd x2p; $(MAKE) install
  
  clean:
! 	rm -f *.o all perl taintperl $suidperl perl.man
  	cd x2p; $(MAKE) clean
  
  realclean:
***************
*** 344,350 ****
  	echo $(sh) | tr ' ' '\012' >.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 <<!GROK!THIS!
! # $Header: Makefile.SH,v 3.0.1.2 89/11/17 15:49:55 lwall Locked $
  #
  # $Log:	Makefile.SH,v $
  # Revision 3.0.1.2  89/11/17  15:49:55  lwall
! # patch: in x2p/Makefile.SH, removed reference to $libnm
  # 
  # Revision 3.0.1.1  89/10/26  23:29:11  lwall
  # patch1: in x2p/Makefile.SH, added dependency on ../config.sh
--- 18,31 ----
  esac
  echo "Extracting x2p/Makefile (with variable substitutions)"
  cat >Makefile <<!GROK!THIS!
! # $Header: Makefile.SH,v 3.0.1.3 89/12/21 20:29:00 lwall Locked $
  #
  # $Log:	Makefile.SH,v $
+ # Revision 3.0.1.3  89/12/21  20:29:00  lwall
+ # patch7: Configure now lets you pick between yacc or bison
+ # 
  # Revision 3.0.1.2  89/11/17  15:49:55  lwall
! # patch: in x2p/Makefile.SH, removed reference to nm library
  # 
  # Revision 3.0.1.1  89/10/26  23:29:11  lwall
  # patch1: in x2p/Makefile.SH, added dependency on ../config.sh
***************
*** 42,47 ****
--- 45,51 ----
  # 
  
  CC = $cc
+ YACC = $yacc
  bin = $bin
  lib = $lib
  mansrc = $mansrc
***************
*** 92,98 ****
  
  a2p.c: a2p.y
  	@ echo Expect 208 shift/reduce conflicts...
! 	yacc a2p.y
  	mv y.tab.c a2p.c
  
  a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h
--- 96,102 ----
  
  a2p.c: a2p.y
  	@ echo Expect 208 shift/reduce conflicts...
! 	$(YACC) a2p.y
  	mv y.tab.c a2p.c
  
  a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h

Index: README
*** README.old	Thu Dec 21 20:33:09 1989
--- README	Thu Dec 21 20:33:11 1989
***************
*** 60,65 ****
--- 60,86 ----
  
      This will attempt to make perl in the current directory.
  
+     If you can't compile successfully, try adding a -DCRIPPLED_CC flag.
+     (Just because you get no errors doesn't mean it compiled right!)
+     This simplifies some complicated expressions for compilers that
+     get indigestion easily.  If that has no effect, try turning off
+     optimization.  If you have missing routines, you probably need to
+     add some library or other, or you need to undefine some feature that
+     Configure thought was there but is defective or incomplete.
+ 
+     Some compilers will not compile or optimize the larger files without
+     some extra switches to use larger jump offsets or allocate larger
+     internal tables.  It's okay to insert rules for specific files into
+     Makefile.SH, since a default rule only take effect in the
+     absence of a specific rule.
+ 
+     The 3b2 needs to turn off -O.
+     AIX/RT may need a -a switch and -DCRIPPLED_CC.
+     SGI machines may need -Ddouble="long float".
+     Ultrix (2.3) may need to hand assemble teval.s with a -J switch.
+     SCO Xenix may need -m25000 for yacc.
+     Genix needs to use libc rather than libc_s, or #undef VARARGS.
+ 
  5)  make test
  
      This will run the regression tests on the perl you just made.
***************
*** 88,94 ****
      Context diffs are the best, then normal diffs.  Don't send ed scripts--
      I've probably changed my copy since the version you have.
  
!     Watch for perl patches in comp.sources.bugs.  Patches will generally be
      in a form usable by the patch program.  If you are just now bringing up
      perl and aren't sure how many patches there are, write to me and I'll
      send any you don't have.  Your current patch level is shown in patchlevel.h.
--- 109,115 ----
      Context diffs are the best, then normal diffs.  Don't send ed scripts--
      I've probably changed my copy since the version you have.
  
!     Watch for perl patches in comp.lang.perl.  Patches will generally be
      in a form usable by the patch program.  If you are just now bringing up
      perl and aren't sure how many patches there are, write to me and I'll
      send any you don't have.  Your current patch level is shown in patchlevel.h.

Index: README.uport
*** README.uport.old	Thu Dec 21 20:33:13 1989
--- README.uport	Thu Dec 21 20:33:15 1989
***************
*** 0 ****
--- 1,34 ----
+ From dwm at uf.msc.umn.edu  Tue Dec 19 15:03:27 1989
+ Subject: perl on Microport Un*x 2.4
+ 
+ Here are the steps to get perl patchlevel 6 running on Microport Un*x 2.4.
+ 
+ (1) Get the directory routines (opendir, readdir, etc) from an archive 
+     somewhere.   I got mine from uunet:  comp.sources.unix/volume9/gwyn-dir-lib
+     and comp.sources.unix/volume10/dir-lib.pch.   Compile a large memory
+     version of the library and put it in /usr/lib/large/dir.a.  Also put
+     the dir.h include file in /usr/include/sys.  [ If you don't want to
+     do this make sure I_SYSDIR does not defined in config.sh ]
+ 
+ (2) Configure causes sh to get a segmentation fault when it does the
+     ". config.sh" near line 2551.   You will have to remove that line 
+     from Configure and make sure you get your configuration info right 
+     the first time or start over if you make a mistake.  
+ 
+ [Or just run the .SH files by hand and proceed to the make depend.]
+ 
+ (3) If you are using C-shell, put a blank line at the start of Configure so it
+     wont get executed by the C-shell.   If you are using ksh, you will have to
+     execute Configure with 'sh Configure'.  Configure does not work with
+     ksh.
+ 
+ (4) When you run Configure, select compilation option -DCRIPPLED_CC.
+     I also selected -DDEBUGGING to make debugging easier.  I recommend it.
+     You can use -O, but you will then have to compile consarg.c and util.c
+     separately without -O because the optimizer generates bad code for these
+     routines.   The optimizer also dies harmlessly while optimizing cmd.c,
+     eval.c (who can blame it? [sorry, Larry]), and toke.c.   
+     I am still trying to isolate the remaining optimization problems in 
+     consarg.c and util.c.
+ 
+ [The rest of the previously published instructions are no longer necessary.]

Index: x2p/a2p.h
Prereq: 3.0.1.1
*** x2p/a2p.h.old	Thu Dec 21 20:38:15 1989
--- x2p/a2p.h	Thu Dec 21 20:38:16 1989
***************
*** 1,4 ****
! /* $Header: a2p.h,v 3.0.1.1 89/11/11 05:07:00 lwall Locked $
   *
   *    Copyright (c) 1989, Larry Wall
   *
--- 1,4 ----
! /* $Header: a2p.h,v 3.0.1.2 89/12/21 20:30:29 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:	a2p.h,v $
+  * Revision 3.0.1.2  89/12/21  20:30:29  lwall
+  * patch7: arranged so a2p has a chance of running on a 286
+  * 
   * Revision 3.0.1.1  89/11/11  05:07:00  lwall
   * patch2: Configure may now set -DDEBUGGING
   * 
***************
*** 213,223 ****
  
  EXT int mop INIT(1);
  
! #define OPSMAX 50000
! union {
      int ival;
      char *cval;
! } ops[OPSMAX];		/* hope they have 200k to spare */
  
  #include <stdio.h>
  #include <ctype.h>
--- 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 <stdio.h>
  #include <ctype.h>

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 <sys/time.h> rather than <time.h>.  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 <sys/time.h>.
-  */
- /* I_TIMETOO:
-  *	This symbol is defined if <sys/time.h> exists but doesn't include
-  *	<time.h>.
-  */
- /* I_SYSTIMETOO:
-  *	This symbol is defined if <sys/time.h> exists but isn't included
-  *	by <time.h>.
-  */
- #$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 <time.h>.
+  */
+ /* I_SYSTIME:
+  *	This symbol is defined if the program should include <sys/time.h>.
+  */
+ /* I_SYSTIMEKERNEL:
+  *	This symbol is defined if the program should include <sys/time.h>
+  *	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



More information about the Comp.sources.bugs mailing list