home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume30 / perl / patch34 < prev    next >
Encoding:
Text File  |  1992-06-12  |  14.3 KB  |  539 lines

  1. Newsgroups: comp.sources.misc
  2. From: lwall@netlabs.com (Larry Wall)
  3. Subject:  v30i045:  perl - The perl programming language, Patch34
  4. Message-ID: <1992Jun12.135957.14457@sparky.imd.sterling.com>
  5. X-Md4-Signature: daacee50d94107d76db826d2e5d9fea0
  6. Date: Fri, 12 Jun 1992 13:59:57 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lwall@netlabs.com (Larry Wall)
  10. Posting-number: Volume 30, Issue 45
  11. Archive-name: perl/patch34
  12. Environment: UNIX, MS-DOS, OS2
  13. Patch-To: perl: Volume 18, Issue 19-54
  14.  
  15. System: perl version 4.0
  16. Patch #: 34
  17. Priority: HIGH
  18. Subject: tests for safe bcopy and memcpy sometimes needed libraries
  19. Subject: join with null list attempted negative allocation
  20. Subject: sprintf("%6.4s", "abcdefg") didn't print "abcd  "
  21. Subject: some systems don't declare h_errno extern in header files
  22. Subject: library files were installed without guaranteed permissions
  23. Subject: changed perlsh to use $/ = "\n\n"
  24. Subject: expectterm incorrectly set to indicate start of program or block
  25. Subject: quotes containing subscripts containing variables didn't parse right
  26. Subject: boneheaded typo in my_bcopy()
  27. Subject: pidgone() wasn't declared right
  28.  
  29. Description:
  30.     Here's the typical cleanup patch that follows any large
  31.     set of patches.  My testing organization is either too large
  32.     or too small, depending on how you look at it, sigh...
  33.  
  34. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your perl source
  35.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  36.     If you don't have the patch program, apply the following by hand,
  37.     or get patch (version 2.0, latest patchlevel).
  38.  
  39.     After patching:
  40.         Configure -d
  41.         make depend
  42.         make
  43.         make test
  44.         make install
  45.  
  46.     If patch indicates that patchlevel is the wrong version, you may need
  47.     to apply one or more previous patches, or the patch may already
  48.     have been applied.  See the patchlevel.h file to find out what has or
  49.     has not been applied.  In any event, don't continue with the patch.
  50.  
  51.     If you are missing previous patches they can be obtained from me:
  52.  
  53.     Larry Wall
  54.     lwall@netlabs.com
  55.  
  56.     If you send a mail message of the following form it will greatly speed
  57.     processing:
  58.  
  59.     Subject: Command
  60.     @SH mailpatch PATH perl 4.0 LIST
  61.            ^ note the c
  62.  
  63.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  64.     or in bang notation from some well-known host, and LIST is the number
  65.     of one or more patches you need, separated by spaces, commas, and/or
  66.     hyphens.  Saying 35- says everything from 35 to the end.
  67.  
  68.  
  69. Index: patchlevel.h
  70. Prereq: 33
  71. 1c1
  72. < #define PATCHLEVEL 33
  73. ---
  74. > #define PATCHLEVEL 34
  75.  
  76. Index: Configure
  77. Prereq: 4.0.1.7
  78. *** Configure.old    Thu Jun 11 21:19:44 1992
  79. --- Configure    Thu Jun 11 21:19:46 1992
  80. ***************
  81. *** 8,14 ****
  82.   # and edit it to reflect your system.  Some packages may include samples
  83.   # of config.h for certain machines, so you might look for one of those.)
  84.   #
  85. ! # $RCSfile: Configure,v $$Revision: 4.0.1.7 $$Date: 92/06/08 11:38:16 $
  86.   #
  87.   # Yes, you may rip this off to use in other distribution packages.
  88.   # (Note: this Configure script was generated automatically.  Rather than
  89. --- 8,14 ----
  90.   # and edit it to reflect your system.  Some packages may include samples
  91.   # of config.h for certain machines, so you might look for one of those.)
  92.   #
  93. ! # $RCSfile: Configure,v $$Revision: 4.0.1.8 $$Date: 92/06/11 21:04:45 $
  94.   #
  95.   # Yes, you may rip this off to use in other distribution packages.
  96.   # (Note: this Configure script was generated automatically.  Rather than
  97. ***************
  98. *** 2080,2086 ****
  99.       exit(0);
  100.   }
  101.   EOCP
  102. !     if $cc safebcpy.c -o safebcpy $ccflags >/dev/null 2>&1 ; then
  103.           if ./safebcpy; then
  104.           echo "It can."
  105.           d_safebcpy=define
  106. --- 2080,2086 ----
  107.       exit(0);
  108.   }
  109.   EOCP
  110. !     if $cc safebcpy.c -o safebcpy $ccflags $libs >/dev/null 2>&1 ; then
  111.           if ./safebcpy; then
  112.           echo "It can."
  113.           d_safebcpy=define
  114. ***************
  115. *** 2465,2471 ****
  116.       exit(0);
  117.   }
  118.   EOCP
  119. !     if $cc safemcpy.c -o safemcpy $ccflags >/dev/null 2>&1 ; then
  120.           if ./safemcpy; then
  121.           echo "It can."
  122.           d_safemcpy=define
  123. --- 2465,2471 ----
  124.       exit(0);
  125.   }
  126.   EOCP
  127. !     if $cc safemcpy.c -o safemcpy $ccflags $libs >/dev/null 2>&1 ; then
  128.           if ./safemcpy; then
  129.           echo "It can."
  130.           d_safemcpy=define
  131.  
  132. Index: doarg.c
  133. *** doarg.c.old    Thu Jun 11 21:20:17 1992
  134. --- doarg.c    Thu Jun 11 21:20:18 1992
  135. ***************
  136. *** 1,4 ****
  137. ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.6 $$Date: 92/06/08 12:34:30 $
  138.    *
  139.    *    Copyright (c) 1991, Larry Wall
  140.    *
  141. --- 1,4 ----
  142. ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.7 $$Date: 92/06/11 21:07:11 $
  143.    *
  144.    *    Copyright (c) 1991, Larry Wall
  145.    *
  146. ***************
  147. *** 6,11 ****
  148. --- 6,15 ----
  149.    *    License or the Artistic License, as specified in the README file.
  150.    *
  151.    * $Log:    doarg.c,v $
  152. +  * Revision 4.0.1.7  92/06/11  21:07:11  lwall
  153. +  * patch34: join with null list attempted negative allocation
  154. +  * patch34: sprintf("%6.4s", "abcdefg") didn't print "abcd  "
  155. +  * 
  156.    * Revision 4.0.1.6  92/06/08  12:34:30  lwall
  157.    * patch20: removed implicit int declarations on funcions
  158.    * patch20: pattern modifiers i and o didn't interact right
  159. ***************
  160. *** 406,412 ****
  161.   
  162.       st += sp + 1;
  163.   
  164. !     len = delimlen * (items - 1);
  165.       if (str->str_len < len + items) {    /* current length is way too short */
  166.       while (items-- > 0) {
  167.           if (*st)
  168. --- 410,416 ----
  169.   
  170.       st += sp + 1;
  171.   
  172. !     len = (items > 0 ? (delimlen * (items - 1) ) : 0);
  173.       if (str->str_len < len + items) {    /* current length is way too short */
  174.       while (items-- > 0) {
  175.           if (*st)
  176. ***************
  177. *** 982,995 ****
  178.               char *mp = index(f, '.');
  179.               int min = atoi(f+2);
  180.   
  181. !             if (xlen < min)
  182. !             post = min - xlen;
  183. !             else if (mp) {
  184.               int max = atoi(mp+1);
  185.   
  186.               if (xlen > max)
  187.                   xlen = max;
  188.               }
  189.               break;
  190.           }
  191.           else if (isDIGIT(f[1])) {
  192. --- 986,999 ----
  193.               char *mp = index(f, '.');
  194.               int min = atoi(f+2);
  195.   
  196. !             if (mp) {
  197.               int max = atoi(mp+1);
  198.   
  199.               if (xlen > max)
  200.                   xlen = max;
  201.               }
  202. +             if (xlen < min)
  203. +             post = min - xlen;
  204.               break;
  205.           }
  206.           else if (isDIGIT(f[1])) {
  207. ***************
  208. *** 996,1009 ****
  209.               char *mp = index(f, '.');
  210.               int min = atoi(f+1);
  211.   
  212. !             if (xlen < min)
  213. !             pre = min - xlen;
  214. !             else if (mp) {
  215.               int max = atoi(mp+1);
  216.   
  217.               if (xlen > max)
  218.                   xlen = max;
  219.               }
  220.               break;
  221.           }
  222.           strcpy(tokenbuf+64,f);    /* sprintf($s,...$s...) */
  223. --- 1000,1013 ----
  224.               char *mp = index(f, '.');
  225.               int min = atoi(f+1);
  226.   
  227. !             if (mp) {
  228.               int max = atoi(mp+1);
  229.   
  230.               if (xlen > max)
  231.                   xlen = max;
  232.               }
  233. +             if (xlen < min)
  234. +             pre = min - xlen;
  235.               break;
  236.           }
  237.           strcpy(tokenbuf+64,f);    /* sprintf($s,...$s...) */
  238.  
  239. Index: doio.c
  240. *** doio.c.old    Thu Jun 11 21:20:26 1992
  241. --- doio.c    Thu Jun 11 21:20:28 1992
  242. ***************
  243. *** 1,4 ****
  244. ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 13:00:21 $
  245.    *
  246.    *    Copyright (c) 1991, Larry Wall
  247.    *
  248. --- 1,4 ----
  249. ! /* $RCSfile: doio.c,v $$Revision: 4.0.1.6 $$Date: 92/06/11 21:08:16 $
  250.    *
  251.    *    Copyright (c) 1991, Larry Wall
  252.    *
  253. ***************
  254. *** 6,11 ****
  255. --- 6,14 ----
  256.    *    License or the Artistic License, as specified in the README file.
  257.    *
  258.    * $Log:    doio.c,v $
  259. +  * Revision 4.0.1.6  92/06/11  21:08:16  lwall
  260. +  * patch34: some systems don't declare h_errno extern in header files
  261. +  * 
  262.    * Revision 4.0.1.5  92/06/08  13:00:21  lwall
  263.    * patch20: some machines don't define ENOTSOCK in errno.h
  264.    * patch20: new warnings for failed use of stat operators on filenames with \n
  265. ***************
  266. *** 62,67 ****
  267. --- 65,74 ----
  268.   #include <sys/select.h>
  269.   #endif
  270.   #endif
  271. + #endif
  272. + #ifdef HOST_NOT_FOUND
  273. + extern int h_errno;
  274.   #endif
  275.   
  276.   #if defined(HAS_MSG) || defined(HAS_SEM) || defined(HAS_SHM)
  277.  
  278. Index: installperl
  279. *** installperl.old    Thu Jun 11 21:20:37 1992
  280. --- installperl    Thu Jun 11 21:20:37 1992
  281. ***************
  282. *** 150,155 ****
  283. --- 150,156 ----
  284.           if ($?) {
  285.           &unlink("$installprivlib/$file");
  286.           &cmd("cp $file $installprivlib");
  287. +         &chmod(0644, "$installprivlib/$file");
  288.           }
  289.       }
  290.       }
  291.  
  292. Index: hints/isc_3_2_3.sh
  293. *** hints/isc_3_2_3.sh.old    Thu Jun 11 21:20:34 1992
  294. --- hints/isc_3_2_3.sh    Thu Jun 11 21:20:34 1992
  295. ***************
  296. *** 0 ****
  297. --- 1,2 ----
  298. + set `echo $libswanted | sed -e 's/ socket / inet /'`
  299. + libswanted="$*"
  300.  
  301. Index: perlsh
  302. *** perlsh.old    Thu Jun 11 21:20:39 1992
  303. --- perlsh    Thu Jun 11 21:20:40 1992
  304. ***************
  305. *** 6,12 ****
  306.   # Note that it must be a complete perl statement--don't type double
  307.   #  carriage return in the middle of a loop.
  308.   
  309. ! $/ = '';    # set paragraph mode
  310.   $SHlinesep = "\n";
  311.   while ($SHcmd = <>) {
  312.       $/ = $SHlinesep;
  313. --- 6,12 ----
  314.   # Note that it must be a complete perl statement--don't type double
  315.   #  carriage return in the middle of a loop.
  316.   
  317. ! $/ = "\n\n";    # set paragraph mode
  318.   $SHlinesep = "\n";
  319.   while ($SHcmd = <>) {
  320.       $/ = $SHlinesep;
  321.  
  322. Index: perly.y
  323. *** perly.y.old    Thu Jun 11 21:20:42 1992
  324. --- perly.y    Thu Jun 11 21:20:43 1992
  325. ***************
  326. *** 1,4 ****
  327. ! /* $RCSfile: perly.y,v $$Revision: 4.0.1.4 $$Date: 92/06/08 17:33:25 $
  328.    *
  329.    *    Copyright (c) 1991, Larry Wall
  330.    *
  331. --- 1,4 ----
  332. ! /* $RCSfile: perly.y,v $$Revision: 4.0.1.5 $$Date: 92/06/11 21:12:50 $
  333.    *
  334.    *    Copyright (c) 1991, Larry Wall
  335.    *
  336. ***************
  337. *** 6,11 ****
  338. --- 6,14 ----
  339.    *    License or the Artistic License, as specified in the README file.
  340.    *
  341.    * $Log:    perly.y,v $
  342. +  * Revision 4.0.1.5  92/06/11  21:12:50  lwall
  343. +  * patch34: expectterm incorrectly set to indicate start of program or block
  344. +  * 
  345.    * Revision 4.0.1.4  92/06/08  17:33:25  lwall
  346.    * patch20: one of the backdoors to expectterm was on the wrong reduction
  347.    * 
  348. ***************
  349. *** 106,113 ****
  350.           {
  351.   #if defined(YYDEBUG) && defined(DEBUGGING)
  352.               yydebug = (debug & 1);
  353. -             expectterm = 2;
  354.   #endif
  355.           }
  356.       /*CONTINUED*/    lineseq
  357.               { if (in_eval)
  358. --- 109,116 ----
  359.           {
  360.   #if defined(YYDEBUG) && defined(DEBUGGING)
  361.               yydebug = (debug & 1);
  362.   #endif
  363. +             expectterm = 2;
  364.           }
  365.       /*CONTINUED*/    lineseq
  366.               { if (in_eval)
  367.  
  368. Index: str.c
  369. *** str.c.old    Thu Jun 11 21:20:49 1992
  370. --- str.c    Thu Jun 11 21:20:50 1992
  371. ***************
  372. *** 1,4 ****
  373. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 15:40:43 $
  374.    *
  375.    *    Copyright (c) 1991, Larry Wall
  376.    *
  377. --- 1,4 ----
  378. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.6 $$Date: 92/06/11 21:14:21 $
  379.    *
  380.    *    Copyright (c) 1991, Larry Wall
  381.    *
  382. ***************
  383. *** 6,11 ****
  384. --- 6,14 ----
  385.    *    License or the Artistic License, as specified in the README file.
  386.    *
  387.    * $Log:    str.c,v $
  388. +  * Revision 4.0.1.6  92/06/11  21:14:21  lwall
  389. +  * patch34: quotes containing subscripts containing variables didn't parse right
  390. +  * 
  391.    * Revision 4.0.1.5  92/06/08  15:40:43  lwall
  392.    * patch20: removed implicit int declarations on functions
  393.    * patch20: Perl now distinguishes overlapped copies from non-overlapped
  394. ***************
  395. *** 1048,1054 ****
  396.               case '&':
  397.               case '*':
  398.               s = scanident(s,send,tokenbuf);
  399. !             break;
  400.               case '\'':
  401.               case '"':
  402.               /*SUPPRESS 68*/
  403. --- 1051,1057 ----
  404.               case '&':
  405.               case '*':
  406.               s = scanident(s,send,tokenbuf);
  407. !             continue;
  408.               case '\'':
  409.               case '"':
  410.               /*SUPPRESS 68*/
  411.  
  412. Index: toke.c
  413. *** toke.c.old    Thu Jun 11 21:20:57 1992
  414. --- toke.c    Thu Jun 11 21:20:58 1992
  415. ***************
  416. *** 1,4 ****
  417. ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.6 $$Date: 92/06/08 16:03:49 $
  418.    *
  419.    *    Copyright (c) 1991, Larry Wall
  420.    *
  421. --- 1,4 ----
  422. ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.7 $$Date: 92/06/11 21:16:30 $
  423.    *
  424.    *    Copyright (c) 1991, Larry Wall
  425.    *
  426. ***************
  427. *** 6,11 ****
  428. --- 6,14 ----
  429.    *    License or the Artistic License, as specified in the README file.
  430.    *
  431.    * $Log:    toke.c,v $
  432. +  * Revision 4.0.1.7  92/06/11  21:16:30  lwall
  433. +  * patch34: expectterm incorrectly set to indicate start of program or block
  434. +  * 
  435.    * Revision 4.0.1.6  92/06/08  16:03:49  lwall
  436.    * patch20: an EXPR may now start with a bareword
  437.    * patch20: print $fh EXPR can now expect term rather than operator in EXPR
  438. ***************
  439. *** 532,538 ****
  440.       yylval.ival = curcmd->c_line;
  441.       if (isSPACE(*s) || *s == '#')
  442.           cmdline = NOLINE;   /* invalidate current command line number */
  443. !     OPERATOR(tmp);
  444.       case ';':
  445.       if (curcmd->c_line < cmdline)
  446.           cmdline = curcmd->c_line;
  447. --- 535,542 ----
  448.       yylval.ival = curcmd->c_line;
  449.       if (isSPACE(*s) || *s == '#')
  450.           cmdline = NOLINE;   /* invalidate current command line number */
  451. !     expectterm = 2;
  452. !     RETURN(tmp);
  453.       case ';':
  454.       if (curcmd->c_line < cmdline)
  455.           cmdline = curcmd->c_line;
  456.  
  457. Index: util.c
  458. *** util.c.old    Thu Jun 11 21:21:05 1992
  459. --- util.c    Thu Jun 11 21:21:06 1992
  460. ***************
  461. *** 1,4 ****
  462. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 16:08:37 $
  463.    *
  464.    *    Copyright (c) 1991, Larry Wall
  465.    *
  466. --- 1,4 ----
  467. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.6 $$Date: 92/06/11 21:18:47 $
  468.    *
  469.    *    Copyright (c) 1991, Larry Wall
  470.    *
  471. ***************
  472. *** 6,11 ****
  473. --- 6,14 ----
  474.    *    License or the Artistic License, as specified in the README file.
  475.    *
  476.    * $Log:    util.c,v $
  477. +  * Revision 4.0.1.6  92/06/11  21:18:47  lwall
  478. +  * patch34: boneheaded typo in my_bcopy()
  479. +  * 
  480.    * Revision 4.0.1.5  92/06/08  16:08:37  lwall
  481.    * patch20: removed implicit int declarations on functions
  482.    * patch20: Perl now distinguishes overlapped copies from non-overlapped
  483. ***************
  484. *** 1185,1191 ****
  485.       to += len;
  486.       from += len;
  487.       while (len--)
  488. !         --*to = --*from;
  489.       }
  490.       return retval;
  491.   }
  492. --- 1188,1194 ----
  493.       to += len;
  494.       from += len;
  495.       while (len--)
  496. !         *(--to) = *(--from);
  497.       }
  498.       return retval;
  499.   }
  500.  
  501. Index: util.h
  502. *** util.h.old    Thu Jun 11 21:21:11 1992
  503. --- util.h    Thu Jun 11 21:21:11 1992
  504. ***************
  505. *** 1,4 ****
  506. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.3 $$Date: 92/06/08 16:09:20 $
  507.    *
  508.    *    Copyright (c) 1991, Larry Wall
  509.    *
  510. --- 1,4 ----
  511. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.4 $$Date: 92/06/11 21:19:36 $
  512.    *
  513.    *    Copyright (c) 1991, Larry Wall
  514.    *
  515. ***************
  516. *** 6,11 ****
  517. --- 6,14 ----
  518.    *    License or the Artistic License, as specified in the README file.
  519.    *
  520.    * $Log:    util.h,v $
  521. +  * Revision 4.0.1.4  92/06/11  21:19:36  lwall
  522. +  * patch34: pidgone() wasn't declared right
  523. +  * 
  524.    * Revision 4.0.1.3  92/06/08  16:09:20  lwall
  525.    * patch20: bcopy() and memcpy() now tested for overlap safety
  526.    * 
  527. ***************
  528. *** 52,54 ****
  529. --- 55,58 ----
  530.   #endif
  531.   unsigned long scanoct();
  532.   unsigned long scanhex();
  533. + void pidgone();
  534.  
  535. *** End of patch 34 ***
  536.  
  537. exit 0 # Just in case...
  538.