home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: lwall@netlabs.com (Larry Wall)
- Subject: v30i045: perl - The perl programming language, Patch34
- Message-ID: <1992Jun12.135957.14457@sparky.imd.sterling.com>
- X-Md4-Signature: daacee50d94107d76db826d2e5d9fea0
- Date: Fri, 12 Jun 1992 13:59:57 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: lwall@netlabs.com (Larry Wall)
- Posting-number: Volume 30, Issue 45
- Archive-name: perl/patch34
- Environment: UNIX, MS-DOS, OS2
- Patch-To: perl: Volume 18, Issue 19-54
-
- System: perl version 4.0
- Patch #: 34
- Priority: HIGH
- Subject: tests for safe bcopy and memcpy sometimes needed libraries
- Subject: join with null list attempted negative allocation
- Subject: sprintf("%6.4s", "abcdefg") didn't print "abcd "
- Subject: some systems don't declare h_errno extern in header files
- Subject: library files were installed without guaranteed permissions
- Subject: changed perlsh to use $/ = "\n\n"
- Subject: expectterm incorrectly set to indicate start of program or block
- Subject: quotes containing subscripts containing variables didn't parse right
- Subject: boneheaded typo in my_bcopy()
- Subject: pidgone() wasn't declared right
-
- Description:
- Here's the typical cleanup patch that follows any large
- set of patches. My testing organization is either too large
- or too small, depending on how you look at it, sigh...
-
- 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:
- Configure -d
- make depend
- make
- make test
- make install
-
- 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@netlabs.com
-
- If you send a mail message of the following form it will greatly speed
- processing:
-
- Subject: Command
- @SH mailpatch PATH perl 4.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.
-
-
- Index: patchlevel.h
- Prereq: 33
- 1c1
- < #define PATCHLEVEL 33
- ---
- > #define PATCHLEVEL 34
-
- Index: Configure
- Prereq: 4.0.1.7
- *** Configure.old Thu Jun 11 21:19:44 1992
- --- Configure Thu Jun 11 21:19:46 1992
- ***************
- *** 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.)
- #
- ! # $RCSfile: Configure,v $$Revision: 4.0.1.7 $$Date: 92/06/08 11:38:16 $
- #
- # 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.)
- #
- ! # $RCSfile: Configure,v $$Revision: 4.0.1.8 $$Date: 92/06/11 21:04:45 $
- #
- # Yes, you may rip this off to use in other distribution packages.
- # (Note: this Configure script was generated automatically. Rather than
- ***************
- *** 2080,2086 ****
- exit(0);
- }
- EOCP
- ! if $cc safebcpy.c -o safebcpy $ccflags >/dev/null 2>&1 ; then
- if ./safebcpy; then
- echo "It can."
- d_safebcpy=define
- --- 2080,2086 ----
- exit(0);
- }
- EOCP
- ! if $cc safebcpy.c -o safebcpy $ccflags $libs >/dev/null 2>&1 ; then
- if ./safebcpy; then
- echo "It can."
- d_safebcpy=define
- ***************
- *** 2465,2471 ****
- exit(0);
- }
- EOCP
- ! if $cc safemcpy.c -o safemcpy $ccflags >/dev/null 2>&1 ; then
- if ./safemcpy; then
- echo "It can."
- d_safemcpy=define
- --- 2465,2471 ----
- exit(0);
- }
- EOCP
- ! if $cc safemcpy.c -o safemcpy $ccflags $libs >/dev/null 2>&1 ; then
- if ./safemcpy; then
- echo "It can."
- d_safemcpy=define
-
- Index: doarg.c
- *** doarg.c.old Thu Jun 11 21:20:17 1992
- --- doarg.c Thu Jun 11 21:20:18 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.6 $$Date: 92/06/08 12:34:30 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.7 $$Date: 92/06/11 21:07:11 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,15 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: doarg.c,v $
- + * Revision 4.0.1.7 92/06/11 21:07:11 lwall
- + * patch34: join with null list attempted negative allocation
- + * patch34: sprintf("%6.4s", "abcdefg") didn't print "abcd "
- + *
- * Revision 4.0.1.6 92/06/08 12:34:30 lwall
- * patch20: removed implicit int declarations on funcions
- * patch20: pattern modifiers i and o didn't interact right
- ***************
- *** 406,412 ****
-
- st += sp + 1;
-
- ! len = delimlen * (items - 1);
- if (str->str_len < len + items) { /* current length is way too short */
- while (items-- > 0) {
- if (*st)
- --- 410,416 ----
-
- st += sp + 1;
-
- ! len = (items > 0 ? (delimlen * (items - 1) ) : 0);
- if (str->str_len < len + items) { /* current length is way too short */
- while (items-- > 0) {
- if (*st)
- ***************
- *** 982,995 ****
- char *mp = index(f, '.');
- int min = atoi(f+2);
-
- ! if (xlen < min)
- ! post = min - xlen;
- ! else if (mp) {
- int max = atoi(mp+1);
-
- if (xlen > max)
- xlen = max;
- }
- break;
- }
- else if (isDIGIT(f[1])) {
- --- 986,999 ----
- char *mp = index(f, '.');
- int min = atoi(f+2);
-
- ! if (mp) {
- int max = atoi(mp+1);
-
- if (xlen > max)
- xlen = max;
- }
- + if (xlen < min)
- + post = min - xlen;
- break;
- }
- else if (isDIGIT(f[1])) {
- ***************
- *** 996,1009 ****
- char *mp = index(f, '.');
- int min = atoi(f+1);
-
- ! if (xlen < min)
- ! pre = min - xlen;
- ! else if (mp) {
- int max = atoi(mp+1);
-
- if (xlen > max)
- xlen = max;
- }
- break;
- }
- strcpy(tokenbuf+64,f); /* sprintf($s,...$s...) */
- --- 1000,1013 ----
- char *mp = index(f, '.');
- int min = atoi(f+1);
-
- ! if (mp) {
- int max = atoi(mp+1);
-
- if (xlen > max)
- xlen = max;
- }
- + if (xlen < min)
- + pre = min - xlen;
- break;
- }
- strcpy(tokenbuf+64,f); /* sprintf($s,...$s...) */
-
- Index: doio.c
- *** doio.c.old Thu Jun 11 21:20:26 1992
- --- doio.c Thu Jun 11 21:20:28 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 13:00:21 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.6 $$Date: 92/06/11 21:08:16 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: doio.c,v $
- + * Revision 4.0.1.6 92/06/11 21:08:16 lwall
- + * patch34: some systems don't declare h_errno extern in header files
- + *
- * Revision 4.0.1.5 92/06/08 13:00:21 lwall
- * patch20: some machines don't define ENOTSOCK in errno.h
- * patch20: new warnings for failed use of stat operators on filenames with \n
- ***************
- *** 62,67 ****
- --- 65,74 ----
- #include <sys/select.h>
- #endif
- #endif
- + #endif
- +
- + #ifdef HOST_NOT_FOUND
- + extern int h_errno;
- #endif
-
- #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
-
- Index: installperl
- *** installperl.old Thu Jun 11 21:20:37 1992
- --- installperl Thu Jun 11 21:20:37 1992
- ***************
- *** 150,155 ****
- --- 150,156 ----
- if ($?) {
- &unlink("$installprivlib/$file");
- &cmd("cp $file $installprivlib");
- + &chmod(0644, "$installprivlib/$file");
- }
- }
- }
-
- Index: hints/isc_3_2_3.sh
- *** hints/isc_3_2_3.sh.old Thu Jun 11 21:20:34 1992
- --- hints/isc_3_2_3.sh Thu Jun 11 21:20:34 1992
- ***************
- *** 0 ****
- --- 1,2 ----
- + set `echo $libswanted | sed -e 's/ socket / inet /'`
- + libswanted="$*"
-
- Index: perlsh
- *** perlsh.old Thu Jun 11 21:20:39 1992
- --- perlsh Thu Jun 11 21:20:40 1992
- ***************
- *** 6,12 ****
- # Note that it must be a complete perl statement--don't type double
- # carriage return in the middle of a loop.
-
- ! $/ = ''; # set paragraph mode
- $SHlinesep = "\n";
- while ($SHcmd = <>) {
- $/ = $SHlinesep;
- --- 6,12 ----
- # Note that it must be a complete perl statement--don't type double
- # carriage return in the middle of a loop.
-
- ! $/ = "\n\n"; # set paragraph mode
- $SHlinesep = "\n";
- while ($SHcmd = <>) {
- $/ = $SHlinesep;
-
- Index: perly.y
- *** perly.y.old Thu Jun 11 21:20:42 1992
- --- perly.y Thu Jun 11 21:20:43 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: perly.y,v $$Revision: 4.0.1.4 $$Date: 92/06/08 17:33:25 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: perly.y,v $$Revision: 4.0.1.5 $$Date: 92/06/11 21:12:50 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: perly.y,v $
- + * Revision 4.0.1.5 92/06/11 21:12:50 lwall
- + * patch34: expectterm incorrectly set to indicate start of program or block
- + *
- * Revision 4.0.1.4 92/06/08 17:33:25 lwall
- * patch20: one of the backdoors to expectterm was on the wrong reduction
- *
- ***************
- *** 106,113 ****
- {
- #if defined(YYDEBUG) && defined(DEBUGGING)
- yydebug = (debug & 1);
- - expectterm = 2;
- #endif
- }
- /*CONTINUED*/ lineseq
- { if (in_eval)
- --- 109,116 ----
- {
- #if defined(YYDEBUG) && defined(DEBUGGING)
- yydebug = (debug & 1);
- #endif
- + expectterm = 2;
- }
- /*CONTINUED*/ lineseq
- { if (in_eval)
-
- Index: str.c
- *** str.c.old Thu Jun 11 21:20:49 1992
- --- str.c Thu Jun 11 21:20:50 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: str.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 15:40:43 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: str.c,v $$Revision: 4.0.1.6 $$Date: 92/06/11 21:14:21 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: str.c,v $
- + * Revision 4.0.1.6 92/06/11 21:14:21 lwall
- + * patch34: quotes containing subscripts containing variables didn't parse right
- + *
- * Revision 4.0.1.5 92/06/08 15:40:43 lwall
- * patch20: removed implicit int declarations on functions
- * patch20: Perl now distinguishes overlapped copies from non-overlapped
- ***************
- *** 1048,1054 ****
- case '&':
- case '*':
- s = scanident(s,send,tokenbuf);
- ! break;
- case '\'':
- case '"':
- /*SUPPRESS 68*/
- --- 1051,1057 ----
- case '&':
- case '*':
- s = scanident(s,send,tokenbuf);
- ! continue;
- case '\'':
- case '"':
- /*SUPPRESS 68*/
-
- Index: toke.c
- *** toke.c.old Thu Jun 11 21:20:57 1992
- --- toke.c Thu Jun 11 21:20:58 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.6 $$Date: 92/06/08 16:03:49 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.7 $$Date: 92/06/11 21:16:30 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: toke.c,v $
- + * Revision 4.0.1.7 92/06/11 21:16:30 lwall
- + * patch34: expectterm incorrectly set to indicate start of program or block
- + *
- * Revision 4.0.1.6 92/06/08 16:03:49 lwall
- * patch20: an EXPR may now start with a bareword
- * patch20: print $fh EXPR can now expect term rather than operator in EXPR
- ***************
- *** 532,538 ****
- yylval.ival = curcmd->c_line;
- if (isSPACE(*s) || *s == '#')
- cmdline = NOLINE; /* invalidate current command line number */
- ! OPERATOR(tmp);
- case ';':
- if (curcmd->c_line < cmdline)
- cmdline = curcmd->c_line;
- --- 535,542 ----
- yylval.ival = curcmd->c_line;
- if (isSPACE(*s) || *s == '#')
- cmdline = NOLINE; /* invalidate current command line number */
- ! expectterm = 2;
- ! RETURN(tmp);
- case ';':
- if (curcmd->c_line < cmdline)
- cmdline = curcmd->c_line;
-
- Index: util.c
- *** util.c.old Thu Jun 11 21:21:05 1992
- --- util.c Thu Jun 11 21:21:06 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: util.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 16:08:37 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: util.c,v $$Revision: 4.0.1.6 $$Date: 92/06/11 21:18:47 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: util.c,v $
- + * Revision 4.0.1.6 92/06/11 21:18:47 lwall
- + * patch34: boneheaded typo in my_bcopy()
- + *
- * Revision 4.0.1.5 92/06/08 16:08:37 lwall
- * patch20: removed implicit int declarations on functions
- * patch20: Perl now distinguishes overlapped copies from non-overlapped
- ***************
- *** 1185,1191 ****
- to += len;
- from += len;
- while (len--)
- ! --*to = --*from;
- }
- return retval;
- }
- --- 1188,1194 ----
- to += len;
- from += len;
- while (len--)
- ! *(--to) = *(--from);
- }
- return retval;
- }
-
- Index: util.h
- *** util.h.old Thu Jun 11 21:21:11 1992
- --- util.h Thu Jun 11 21:21:11 1992
- ***************
- *** 1,4 ****
- ! /* $RCSfile: util.h,v $$Revision: 4.0.1.3 $$Date: 92/06/08 16:09:20 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- --- 1,4 ----
- ! /* $RCSfile: util.h,v $$Revision: 4.0.1.4 $$Date: 92/06/11 21:19:36 $
- *
- * Copyright (c) 1991, Larry Wall
- *
- ***************
- *** 6,11 ****
- --- 6,14 ----
- * License or the Artistic License, as specified in the README file.
- *
- * $Log: util.h,v $
- + * Revision 4.0.1.4 92/06/11 21:19:36 lwall
- + * patch34: pidgone() wasn't declared right
- + *
- * Revision 4.0.1.3 92/06/08 16:09:20 lwall
- * patch20: bcopy() and memcpy() now tested for overlap safety
- *
- ***************
- *** 52,54 ****
- --- 55,58 ----
- #endif
- unsigned long scanoct();
- unsigned long scanhex();
- + void pidgone();
-
- *** End of patch 34 ***
-
- exit 0 # Just in case...
-