[comp.sources.bugs] perl 1.0 patch #1

lroot@devvax.JPL.NASA.GOV (The Superuser) (01/22/88)

System: perl version 1.0
Patch #: 1
Priority: MEDIUM
Subject: Portability bugs and one possible SIGSEGV
From: Dan Faigin, Doug Landauer

Description:
	On some systems the Configure script and C compilations get
	warning messages that may scare some folks unnecessarily.

	Also, use of the "redo" command if debugging is compiled in
	overflows a stack on which the trace context is kept.

Fix:	From rn, say "| patch -d DIR", where DIR is your perl source
	directory.  Outside of rn, say "cd DIR; patch <thisarticle".
	If you don't have the patch program, apply the following by hand,
	or get patch.

	If patch indicates that patchlevel is the wrong version, the patch
	may already have been applied.  See the patchlevel.h file to find out
	what has or has not been applied.

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

	Larry Wall
	lwall@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 1.0 LIST
		   ^ note the c

	where PATH is a return path FROM ME TO YOU in Internet notation, 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 my site, which is
	jpl-devvax.jpl.nasa.gov (128.149.8.13).

Index: patchlevel.h
Prereq: 0
1c1
< #define PATCHLEVEL 0
---
> #define PATCHLEVEL 1
 
Index: Configure
Prereq: 1.0
*** Configure.old	Thu Jan 21 22:20:21 1988
*** Configure	Thu Jan 21 22:20:22 1988
***************
*** 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 1.0 87/12/18 15:05:56 root Exp $
  #
  # 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 1.0.1.1 88/01/21 21:21:47 root Exp $
  #
  # Yes, you may rip this off to use in other distribution packages.
  # (Note: this Configure script was generated automatically.  Rather than
***************
*** 67,76 ****
--- 67,79 ----
  cc=''
  contains=''
  cpp=''
+ cppminus=''
  d_charsprf=''
  d_index=''
+ d_stdstdio=''
  d_strctcpy=''
  d_vfork=''
+ d_voidsig=''
  libc=''
  libnm=''
  mansrc=''
***************
*** 90,95 ****
--- 93,99 ----
  shsharp=''
  sharpbang=''
  startsh=''
+ stdchar=''
  voidflags=''
  defvoidused=''
  CONFIG=''
***************
*** 110,116 ****
  trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
  attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
! attrlist="$attrlist ns32000 ns16000 iAPX286"
  pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib"
  defvoidused=7
  
--- 114,120 ----
  trap 'echo " "; rm -f $rmlist; exit 1' 1 2 3
  attrlist="mc68000 sun gcos unix ibm gimpel interdata tss os mert pyr"
  attrlist="$attrlist vax pdp11 i8086 z8000 u3b2 u3b5 u3b20 u3b200"
! attrlist="$attrlist ns32000 ns16000 iAPX286 mc300 mc500 mc700 sparc"
  pth="/usr/ucb /bin /usr/bin /usr/local /usr/local/bin /usr/lbin /etc /usr/lib"
  defvoidused=7
  
***************
*** 200,207 ****
  
  Much effort has been expended to ensure that this shell script will run
  on any Unix system.  If despite that it blows up on you, your best bet is
! to edit Configure and run it again. Also, let me (lwall@sdcrdcf.UUCP) know
! how I blew it.  If you can't run Configure for some reason, you'll have
  to generate a config.sh file by hand.
  
  This installation script affects things in two ways: 1) it may do direct
--- 204,211 ----
  
  Much effort has been expended to ensure that this shell script will run
  on any Unix system.  If despite that it blows up on you, your best bet is
! to edit Configure and run it again. Also, let me (lwall@jpl-devvax.jpl.nasa.gov)
! know how I blew it.  If you can't run Configure for some reason, you'll have
  to generate a config.sh file by hand.
  
  This installation script affects things in two ways: 1) it may do direct
***************
*** 546,551 ****
--- 550,643 ----
  fi
  rm -f try today
  
+ : see how we invoke the C preprocessor
+ echo " "
+ echo "Now, how can we feed standard input to your C preprocessor..."
+ cat <<'EOT' >testcpp.c
+ #define ABC abc
+ #define XYZ xyz
+ ABC.XYZ
+ EOT
+ echo 'Maybe "/lib/cpp" will work...'
+ /lib/cpp <testcpp.c >testcpp.out 2>&1
+ if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+     echo "Yup, it does."
+     cpp='/lib/cpp'
+     cppminus='';
+ else
+     echo 'Nope, maybe "/lib/cpp -" will work...'
+     /lib/cpp - <testcpp.c >testcpp.out 2>&1
+     if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 	echo "Yup, it does."
+ 	cpp='/lib/cpp'
+ 	cppminus='-';
+     else
+ 	echo 'No such luck...maybe "cc -E" will work...'
+ 	cc -E <testcpp.c >testcpp.out 2>&1
+ 	if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 	    echo "It works!"
+ 	    cpp='cc -E'
+ 	    cppminus='';
+ 	else
+ 	    echo 'Nixed again...maybe "cc -E -" will work...'
+ 	    cc -E - <testcpp.c >testcpp.out 2>&1
+ 	    if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 		echo "Hooray, it works!  I was beginning to wonder."
+ 		cpp='cc -E'
+ 		cppminus='-';
+ 	    else
+ 		echo 'Nope...maybe "cc -P" will work...'
+ 		cc -P <testcpp.c >testcpp.out 2>&1
+ 		if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 		    echo "Yup, that does."
+ 		    cpp='cc -P'
+ 		    cppminus='';
+ 		else
+ 		    echo 'Nope...maybe "cc -P -" will work...'
+ 		    cc -P - <testcpp.c >testcpp.out 2>&1
+ 		    if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 			echo "Yup, that does."
+ 			cpp='cc -P'
+ 			cppminus='-';
+ 		    else
+ 			echo 'Hmm...perhaps you already told me...'
+ 			case "$cpp" in
+ 			'') ;;
+ 			*) $cpp $cppminus <testcpp.c >testcpp.out 2>&1;;
+ 			esac
+ 			if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 			    echo "Hooray, you did!  I was beginning to wonder."
+ 			else
+ 			    echo 'Uh-uh.  Time to get fancy...'
+ 			    echo 'Trying (cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
+ 			    cpp='(cat >/tmp/$$.c; cc -E /tmp/$$.c; rm /tmp/$$.c)'
+ 			    cppminus='';
+ 			    $cpp <testcpp.c >testcpp.out 2>&1
+ 			    if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 				echo "Eureka!."
+ 			    else
+ 				dflt=blurfl
+ 				$echo $n "No dice.  I can't find a C preprocessor.  Name one: $c"
+ 				rp='Name a C preprocessor:'
+ 				. myread
+ 				cpp="$ans"
+ 				$cpp <testcpp.c >testcpp.out 2>&1
+ 				if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
+ 				    echo "OK, that will do."
+ 				else
+ 				    echo "Sorry, I can't get that to work.  Go find one."
+ 				    exit 1
+ 				fi
+ 			    fi
+ 			fi
+ 		    fi
+ 		fi
+ 	    fi
+ 	fi
+     fi
+ fi
+ rm -f testcpp.c testcpp.out
+ 
  : see if sprintf is declared as int or pointer to char
  echo " "
  if $contains 'char.*sprintf' /usr/include/stdio.h >/dev/null 2>&1 ; then
***************
*** 579,584 ****
--- 671,691 ----
      esac
  fi
  
+ : see if stdio is really std
+ echo " "
+ if $contains 'char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
+     if $contains '_cnt;' /usr/include/stdio.h >/dev/null 2>&1 ; then
+ 	echo "Your stdio is pretty std."
+ 	d_stdstdio="$define"
+     else
+ 	echo "Your stdio isn't very std."
+ 	d_stdstdio="$undef"
+     fi
+ else
+     echo "Your stdio isn't very std."
+     d_stdstdio="$undef"
+ fi
+ 
  : check for structure copying
  echo " "
  echo "Checking to see if your C compiler can copy structs..."
***************
*** 611,616 ****
--- 718,733 ----
      d_vfork="$define"
  fi
  
+ : see if signal is declared as pointer to function returning int or void
+ echo " "
+ if $contains 'void.*signal' /usr/include/signal.h >/dev/null 2>&1 ; then
+     echo "You have void (*signal())() instead of int."
+     d_voidsig="$define"
+ else
+     echo "You have int (*signal())() instead of void."
+     d_voidsig="$undef"
+ fi
+ 
  : check for void type
  echo " "
  $cat <<EOM
***************
*** 681,686 ****
--- 798,813 ----
  voidflags="$ans"
  $rm -f try.* .out
  
+ : see what type of char stdio uses.
+ echo " "
+ if $contains 'unsigned.*char.*_ptr;' /usr/include/stdio.h >/dev/null 2>&1 ; then
+     echo "Your stdio uses unsigned chars."
+     stdchar="unsigned char"
+ else
+     echo "Your stdio uses signed chars."
+     stdchar="char"
+ fi
+ 
  : preserve RCS keywords in files with variable substitution, grrr
  Log='$Log'
  Header='$Header'
***************
*** 793,853 ****
      ;;
  esac
  
- : see how we invoke the C preprocessor
- echo " "
- echo "Checking to see how your C preprocessor is invoked..."
- cat <<'EOT' >testcpp.c
- #define ABC abc
- #define XYZ xyz
- ABC.XYZ
- EOT
- echo 'Maybe "cc -E" will work...'
- cc -E testcpp.c >testcpp.out 2>&1
- if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
-     echo "Yup, it does."
-     cpp='cc -E'
- else
-     echo 'Nope...maybe "cc -P" will work...'
-     cc -P testcpp.c >testcpp.out 2>&1
-     if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
- 	echo "Yup, that does."
- 	cpp='cc -P'
-     else
- 	echo 'Nixed again...maybe "/lib/cpp" will work...'
- 	/lib/cpp testcpp.c >testcpp.out 2>&1
- 	if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
- 	    echo "Hooray, it works!  I was beginning to wonder."
- 	    cpp='/lib/cpp'
- 	else
- 	    echo 'Hmm...maybe you already told me...'
- 	    case "$cpp" in
- 	    '') ;;
- 	    *) $cpp testcpp.c >testcpp.out 2>&1;;
- 	    esac
- 	    if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
- 		echo "Hooray, you did!  I was beginning to wonder."
- 	    else
- 		dflt=blurfl
- 		$echo $n "Nope. I can't find a C preprocessor.  Name one: $c"
- 		rp='Name a C preprocessor:'
- 		. myread
- 		cpp="$ans"
- 		$cpp testcpp.c >testcpp.out 2>&1
- 		if $contains 'abc.xyz' testcpp.out >/dev/null 2>&1 ; then
- 		    echo "OK, that will do."
- 		else
- 		    echo "Sorry, I can't get that to work.  Go find one."
- 		    exit 1
- 		fi
- 	    fi
- 	fi
-     fi
- fi
- rm -f testcpp.c testcpp.out
- 
  : get C preprocessor symbols handy
  echo " "
! echo $attrlist | $tr '[ ]' '[\012]' >Cppsym.know
  $cat <<EOSS >Cppsym
  $startsh
  case "\$1" in
--- 920,928 ----
      ;;
  esac
  
  : get C preprocessor symbols handy
  echo " "
! echo $attrlist | $tr '[ - ]' '[\012-\012]' >Cppsym.know
  $cat <<EOSS >Cppsym
  $startsh
  case "\$1" in
***************
*** 874,886 ****
  case \$# in
  0) exit 1;;
  esac
! echo \$* | $tr '[ ]' '[\012]' | $sed -e 's/\(.*\)/\\
  #ifdef \1\\
  exit 0; _ _ _ _\1\\	 \1\\
  #endif\\
  /' >/tmp/Cppsym\$\$
  echo exit 1 >>/tmp/Cppsym\$\$
! $cpp /tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  case "\$list" in
  true) awk '\$6 != "" {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  *)
--- 949,961 ----
  case \$# in
  0) exit 1;;
  esac
! echo \$* | $tr '[ - ]' '[\012-\012]' | $sed -e 's/\(.*\)/\\
  #ifdef \1\\
  exit 0; _ _ _ _\1\\	 \1\\
  #endif\\
  /' >/tmp/Cppsym\$\$
  echo exit 1 >>/tmp/Cppsym\$\$
! $cpp $cppminus </tmp/Cppsym\$\$ >/tmp/Cppsym2\$\$
  case "\$list" in
  true) awk '\$6 != "" {print substr(\$6,2,100)}' </tmp/Cppsym2\$\$ ;;
  *)
***************
*** 1123,1129 ****
      echo "New math library found."
      libnm='-lnm'
  else
!     ans=`loc libtermlib.a x $libpth`
      case "$ans" in
      x)
  	echo "No nm library found--the normal math library will have to do."
--- 1198,1204 ----
      echo "New math library found."
      libnm='-lnm'
  else
!     ans=`loc libnm.a x $libpth`
      case "$ans" in
      x)
  	echo "No nm library found--the normal math library will have to do."
***************
*** 1184,1193 ****
--- 1259,1271 ----
  cc='$cc'
  contains='$contains'
  cpp='$cpp'
+ cppminus='$cppminus'
  d_charsprf='$d_charsprf'
  d_index='$d_index'
+ d_stdstdio='$d_stdstdio'
  d_strctcpy='$d_strctcpy'
  d_vfork='$d_vfork'
+ d_voidsig='$d_voidsig'
  libc='$libc'
  libnm='$libnm'
  mansrc='$mansrc'
***************
*** 1207,1212 ****
--- 1285,1291 ----
  shsharp='$shsharp'
  sharpbang='$sharpbang'
  startsh='$startsh'
+ stdchar='$stdchar'
  voidflags='$voidflags'
  defvoidused='$defvoidused'
  CONFIG=true
***************
*** 1228,1234 ****
  
  echo " "
  echo "Doing variable substitutions on .SH files..."
! set `$grep '\.SH' <MANIFEST | awk '{print $1}'`
  for file in $*; do
      case "$file" in
      */*)
--- 1307,1320 ----
  
  echo " "
  echo "Doing variable substitutions on .SH files..."
! set x `$grep '\.SH' <MANIFEST | awk '{print $1}'`
! shift
! case $# in
! 0) set x *.SH; shift;;
! esac
! if test ! -f $1; then
!     shift
! fi
  for file in $*; do
      case "$file" in
      */*)
 
Index: arg.c
Prereq: 1.0
*** arg.c.old	Thu Jan 21 22:20:55 1988
*** arg.c	Thu Jan 21 22:20:56 1988
***************
*** 1,6 ****
! /* $Header: arg.c,v 1.0 87/12/18 13:04:33 root Exp $
   *
   * $Log:	arg.c,v $
   * Revision 1.0  87/12/18  13:04:33  root
   * Initial revision
   * 
--- 1,9 ----
! /* $Header: arg.c,v 1.0.1.1 88/01/21 21:27:10 root Exp $
   *
   * $Log:	arg.c,v $
+  * Revision 1.0.1.1  88/01/21  21:27:10  root
+  * Now defines signal return values correctly using VOIDSIG.
+  * 
   * Revision 1.0  87/12/18  13:04:33  root
   * Initial revision
   * 
***************
*** 1173,1180 ****
--- 1176,1188 ----
      opargs[O_REPEAT] =		A(1,1,0);
  }
  
+ #ifdef VOIDSIG
+ static void (*ihand)();
+ static void (*qhand)();
+ #else
  static int (*ihand)();
  static int (*qhand)();
+ #endif
  
  STR *
  eval(arg,retary)
 
Index: cmd.c
Prereq: 1.0
*** cmd.c.old	Thu Jan 21 22:20:30 1988
*** cmd.c	Thu Jan 21 22:20:31 1988
***************
*** 1,6 ****
! /* $Header: cmd.c,v 1.0 87/12/18 13:04:51 root Exp $
   *
   * $Log:	cmd.c,v $
   * Revision 1.0  87/12/18  13:04:51  root
   * Initial revision
   * 
--- 1,9 ----
! /* $Header: cmd.c,v 1.0.1.1 88/01/21 21:24:16 root Exp $
   *
   * $Log:	cmd.c,v $
+  * Revision 1.0.1.1  88/01/21  21:24:16  root
+  * The redo cmd got a segmentation fault because trace context stack overflowed.
+  * 
   * Revision 1.0  87/12/18  13:04:51  root
   * Initial revision
   * 
***************
*** 383,388 ****
--- 386,394 ----
  	case O_NEXT:
  	    goto next_iter;
  	case O_REDO:
+ #ifdef DEBUGGING
+ 	    dlevel = olddlevel;
+ #endif
  	    goto doit;
  	}
  	oldspat = curspat;
 
Index: config.h.SH
*** config.h.SH.old	Thu Jan 21 22:20:49 1988
*** config.h.SH	Thu Jan 21 22:20:49 1988
***************
*** 37,42 ****
--- 37,56 ----
  #$d_eunice	EUNICE		/**/
  #$d_eunice	VMS		/**/
  
+ /* CPP:
+  *	This symbol contains the first part of the string which will invoke
+  *	the C preprocessor on the standard input and produce to standard
+  *	output.	 Typical value of "cc -E" or "/lib/cpp".
+  */
+ /* CPPMINUS:
+  *	This symbol contains the second part of the string which will invoke
+  *	the C preprocessor on the standard input and produce to standard
+  *	output.  This symbol will have the value "-" if CPP needs a minus
+  *	to specify standard input, otherwise the value is "".
+  */
+ #define CPP "$cpp"
+ #define CPPMINUS "$cppminus"
+ 
  /* CHARSPRINTF:
   *	This symbol is defined if this system declares "char *sprintf()" in
   *	stdio.h.  The trend seems to be to declare it as "int sprintf()".  It
***************
*** 56,61 ****
--- 70,81 ----
  #$d_index	index strchr	/* cultural */
  #$d_index	rindex strrchr	/*  differences? */
  
+ /* STDSTDIO:
+  *	This symbol is defined if this system has a FILE structure declaring
+  *	_ptr and _cnt in stdio.h.
+  */
+ #$d_stdstdio	STDSTDIO 	/**/
+ 
  /* STRUCTCOPY:
   *	This symbol, if defined, indicates that this C compiler knows how
   *	to copy structures.  If undefined, you'll need to use a block copy
***************
*** 68,73 ****
--- 88,107 ----
   *	vfork() routine isn't supported here.
   */
  #$d_vfork	vfork fork	/**/
+ 
+ /* VOIDSIG:
+  *	This symbol is defined if this system declares "void (*signal())()" in
+  *	signal.h.  The old way was to declare it as "int (*signal())()".  It
+  *	is up to the package author to declare things correctly based on the
+  *	symbol.
+  */
+ #$d_voidsig	VOIDSIG 	/**/
+ 
+ /* STDCHAR:
+  *	This symbol is defined to be the type of char used in stdio.h.
+  *	It has the values "unsigned char" or "char".
+  */
+ #define STDCHAR $stdchar	/**/
  
  /* VOIDFLAGS:
   *	This symbol indicates how much support of the void type is given by this
 
Index: perl.h
Prereq: 1.0
*** perl.h.old	Thu Jan 21 22:21:11 1988
*** perl.h	Thu Jan 21 22:21:12 1988
***************
*** 1,6 ****
! /* $Header: perl.h,v 1.0 87/12/18 13:05:38 root Exp $
   *
   * $Log:	perl.h,v $
   * Revision 1.0  87/12/18  13:05:38  root
   * Initial revision
   * 
--- 1,9 ----
! /* $Header: perl.h,v 1.0.1.1 88/01/21 21:29:23 root Exp $
   *
   * $Log:	perl.h,v $
+  * Revision 1.0.1.1  88/01/21  21:29:23  root
+  * No longer defines STDSTDIO--gets it from config.h now.
+  * 
   * Revision 1.0  87/12/18  13:05:38  root
   * Initial revision
   * 
***************
*** 7,13 ****
   */
  
  #define DEBUGGING
- #define STDSTDIO	/* eventually should be in config.h */
  
  #define VOIDUSED 1
  #include "config.h"
--- 10,15 ----
 
Index: perly.c
Prereq: 1.0
*** perly.c.old	Thu Jan 21 22:20:38 1988
*** perly.c	Thu Jan 21 22:20:40 1988
***************
*** 1,6 ****
! char rcsid[] = "$Header: perly.c,v 1.0 87/12/18 15:53:31 root Exp $";
  /*
   * $Log:	perly.c,v $
   * Revision 1.0  87/12/18  15:53:31  root
   * Initial revision
   * 
--- 1,9 ----
! char rcsid[] = "$Header: perly.c,v 1.0.1.1 88/01/21 21:25:57 root Exp $";
  /*
   * $Log:	perly.c,v $
+  * Revision 1.0.1.1  88/01/21  21:25:57  root
+  * Now uses CPP and CPPMINUS symbols from config.h.
+  * 
   * Revision 1.0  87/12/18  15:53:31  root
   * Initial revision
   * 
***************
*** 118,125 ****
   -e '/^#[ 	]*else/b' \
   -e '/^#[ 	]*endif/b' \
   -e 's/^#.*//' \
!  %s | /lib/cpp -C %s-",
! 	  argv[0], str_get(str));
  	rsfp = popen(buf,"r");
      }
      else if (!*argv[0])
--- 121,128 ----
   -e '/^#[ 	]*else/b' \
   -e '/^#[ 	]*endif/b' \
   -e 's/^#.*//' \
!  %s | %s -C %s%s",
! 	  argv[0], CPP, str_get(str), CPPMINUS);
  	rsfp = popen(buf,"r");
      }
      else if (!*argv[0])
 
Index: str.c
Prereq: 1.0
*** str.c.old	Thu Jan 21 22:21:04 1988
*** str.c	Thu Jan 21 22:21:04 1988
***************
*** 1,6 ****
! /* $Header: str.c,v 1.0 87/12/18 13:06:22 root Exp $
   *
   * $Log:	str.c,v $
   * Revision 1.0  87/12/18  13:06:22  root
   * Initial revision
   * 
--- 1,9 ----
! /* $Header: str.c,v 1.0.1.1 88/01/21 21:28:39 root Exp $
   *
   * $Log:	str.c,v $
+  * Revision 1.0.1.1  88/01/21  21:28:39  root
+  * Suppressed warning messages on signed vs unsigned chars in str_gets().
+  * 
   * Revision 1.0  87/12/18  13:06:22  root
   * Initial revision
   * 
***************
*** 318,325 ****
  
      register char *bp;		/* we're going to steal some values */
      register int cnt;		/*  from the stdio struct and put EVERYTHING */
!     register char *ptr;		/*   in the innermost loop into registers */
!     register char newline = record_separator;	/* (assuming >= 6 registers) */
      int i;
      int bpx;
      int obpx;
--- 321,328 ----
  
      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 */
!     register char newline = record_separator;/* (assuming >= 6 registers) */
      int i;
      int bpx;
      int obpx;

lwall@devvax.JPL.NASA.GOV (Larry Wall) (01/23/88)

In article <8077@e.ms.uky.edu> david@ms.uky.edu (David Herron -- Resident
    E-mail Hack) writes:
: If I had something to apply it TO, I'd certainly apply it.
: 
: (Hey Rich!  wink wink, nudge nudge :-) :-) :-) :-) :-) :-) :-) :-)).

If you get impatient, and have Internet access, you can FTP it from
jpl-devvax.jpl.nasa.gov (128.149.8.43).  The 128.149.8.13 given in the
first patch was incorrect.  I challenge you to snarf perl and find a bug
before r$ posts the kits.  (Wink, wink, nudge, nudge :-)

Some of you have expressed interest in trying out metaconfig.  Well, here's
your big chance.  I'm not going to post it yet, but you can get it via
FTP from the same place.  It's actually part of a package called "dist".
This package is very useful in its current form, but I suspect it is going
to evolve considerably over the next year or so.  So give me some feedback
on how you think it should grow.

The dist kit has three parts:

1) A kit builder.  Generates MANIFEST file, packs kits semi-optimally, and
    shars the kits for you.

2) A patch generator.  I don't suggest you use this unless you are familiar
    with RCS.  You just say "pat filelist", where filelist is the list of
    files you changed, and it checks them all in, creating a branch as
    necessary, keeping all the locking straight.  Then it does your diffs
    for you, using either rcsdiff or your own diff, and then it builds and
    lets you edit the new patch.  It does all this even when some of the files
    are in subdirectories, which RCS isn't very smart about.

3) Metaconfig.  This is the hottest part of the package, and you may want
    this even if you don't want the other parts.  This package knows just
    about everything I know about portability to Unix systems.  Everything
    is driven off a set of Unit files, each of which is designed to find
    out one piece of information about the system on which your package will
    run.  The niftiest thing is that each of these units is self-contained:
    Each unit knows what cpp symbols and shell variables it defines, what
    other units it depends on, the definitions for the symbols and variables,
    the shell code to determine the correct value for the symbols and variables,
    and the code to insert into config.h so that your C programs know what's
    going on.  Here's what you do to use it: a) run makegloss to build a
    Glossary from all the units,  b) read the Glossary to see which variables
    and symbols metaconfig can determine for you, c) write your programs
    and scripts (including your Makefile generator) in terms of those variables
    and symbols, and d) run metaconfig, which will analyze your files and
    write a Configure script for them.  That's pretty much all you have to do.
    If you so desire you can write custom units for inclusion in Configure.

Please don't expect a polished product--if you don't read shell scripts and
README files, you don't want dist.  Dist is like a good road with mud on
both sides at the moment.  As long as you stay in the center of the road
you'll get where you want to go very quickly, but you'd better have a shovel
along just in case.

I'm not planning to mail this out to anyone unless you have a project you're
dying to use it on.  I figure I'll get plenty of beta testers who can ftp it.

Be sure to pick up any patches for the dist kit as well.  Here's the directory
structure for ~ftp.

    ftp/pub/perl.1.0
    ftp/pub/perl.1.0/kits
    ftp/pub/perl.1.0/patches
    ftp/pub/dist.1.0
    ftp/pub/dist.1.0/kits
    ftp/pub/dist.1.0/patches
    ftp/pub/warp.7.0
    ftp/pub/warp.7.0/kits
    ftp/pub/warp.7.0/patches

Of course, don't let dist or warp distract you from getting perl.  :-)

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

allbery@ncoast.UUCP (Brandon Allbery) (01/29/88)

As quoted from <1093@devvax.JPL.NASA.GOV> by lroot@devvax.JPL.NASA.GOV (The Superuser):
+---------------
| System: perl version 1.0
| Patch #: 1
| Fix:	From rn, say "| patch -d DIR", where DIR is your perl source
+---------------

Sorry, no got -- my twin went west.  ;-)

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

...we number patches from 0 now?  ;-)
-- 
	      Brandon S. Allbery, moderator of comp.sources.misc
       {well!hoptoad,uunet!hnsurg3,cbosgd,sun!mandrill}!ncoast!allbery
 PS/2:  Half a computer.  OS/2:  Half an operating system for half a computer.