home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume20 / perl / patch09 < prev    next >
Encoding:
Text File  |  1991-06-19  |  42.5 KB  |  1,513 lines

  1. Newsgroups: comp.sources.misc
  2. From: Larry Wall <lwall@netlabs.com>
  3. Subject:  v20i061:  perl - The perl programming language, Patch09
  4. Message-ID: <1991Jun20.030804.8856@sparky.IMD.Sterling.COM>
  5. X-Md4-Signature: cff95b02c3fe2aec391ad261a3dfce40
  6. Date: Thu, 20 Jun 1991 03:08:04 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: Larry Wall <lwall@netlabs.com>
  10. Posting-number: Volume 20, Issue 61
  11. Archive-name: perl/patch09
  12. Patch-To: perl: Volume 18, Issue 19-54
  13.  
  14. System: perl version 4.0
  15. Patch #: 9
  16. Priority: High
  17. Subject: patch #4, continued
  18.  
  19. Description:
  20.     See patch #4.
  21.  
  22. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your perl source
  23.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  24.     If you don't have the patch program, apply the following by hand,
  25.     or get patch (version 2.0, latest patchlevel).
  26.  
  27.     After patching:
  28.         Configure -d
  29.         make depend
  30.         make
  31.         make test
  32.         make install
  33.  
  34.     If patch indicates that patchlevel is the wrong version, you may need
  35.     to apply one or more previous patches, or the patch may already
  36.     have been applied.  See the patchlevel.h file to find out what has or
  37.     has not been applied.  In any event, don't continue with the patch.
  38.  
  39.     If you are missing previous patches they can be obtained from me:
  40.  
  41.     Larry Wall
  42.     lwall@netlabs.com
  43.  
  44.     If you send a mail message of the following form it will greatly speed
  45.     processing:
  46.  
  47.     Subject: Command
  48.     @SH mailpatch PATH perl 4.0 LIST
  49.            ^ note the c
  50.  
  51.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  52.     or in bang notation from some well-known host, and LIST is the number
  53.     of one or more patches you need, separated by spaces, commas, and/or
  54.     hyphens.  Saying 35- says everything from 35 to the end.
  55.  
  56.  
  57. Index: patchlevel.h
  58. Prereq: 8
  59. 1c1
  60. < #define PATCHLEVEL 8
  61. ---
  62. > #define PATCHLEVEL 9
  63.  
  64. Index: stab.h
  65. Prereq: 4.0
  66. *** stab.h.old    Fri Jun  7 12:26:50 1991
  67. --- stab.h    Fri Jun  7 12:26:51 1991
  68. ***************
  69. *** 1,11 ****
  70. ! /* $Header: stab.h,v 4.0 91/03/20 01:39:49 lwall Locked $
  71.    *
  72. !  *    Copyright (c) 1989, Larry Wall
  73.    *
  74. !  *    You may distribute under the terms of the GNU General Public License
  75. !  *    as specified in the README file that comes with the perl 3.0 kit.
  76.    *
  77.    * $Log:    stab.h,v $
  78.    * Revision 4.0  91/03/20  01:39:49  lwall
  79.    * 4.0 baseline.
  80.    * 
  81. --- 1,15 ----
  82. ! /* $RCSfile: stab.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:56:35 $
  83.    *
  84. !  *    Copyright (c) 1991, Larry Wall
  85.    *
  86. !  *    You may distribute under the terms of either the GNU General Public
  87. !  *    License or the Artistic License, as specified in the README file.
  88.    *
  89.    * $Log:    stab.h,v $
  90. +  * Revision 4.0.1.1  91/06/07  11:56:35  lwall
  91. +  * patch4: new copyright notice
  92. +  * patch4: length($`), length($&), length($') now optimized to avoid string copy
  93. +  * 
  94.    * Revision 4.0  91/03/20  01:39:49  lwall
  95.    * 4.0 baseline.
  96.    * 
  97. ***************
  98. *** 93,99 ****
  99. --- 97,106 ----
  100.   
  101.   #define Nullstab Null(STAB*)
  102.   
  103. + STRLEN stab_len();
  104.   #define STAB_STR(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_str(stab_val(tmpstab)->str_magic) : stab_val(tmpstab))
  105. + #define STAB_LEN(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_len(stab_val(tmpstab)->str_magic) : stab_val(tmpstab)->str_cur)
  106.   #define STAB_GET(s) (tmpstab = (s), str_get(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
  107.   #define STAB_GNUM(s) (tmpstab = (s), str_gnum(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
  108.   
  109.  
  110. Index: t/op/stat.t
  111. Prereq: 4.0
  112. *** t/op/stat.t.old    Fri Jun  7 12:27:11 1991
  113. --- t/op/stat.t    Fri Jun  7 12:27:12 1991
  114. ***************
  115. *** 1,11 ****
  116.   #!./perl
  117.   
  118. ! # $Header: stat.t,v 4.0 91/03/20 01:54:55 lwall Locked $
  119.   
  120.   print "1..56\n";
  121.   
  122.   chop($cwd = `pwd`);
  123.   
  124.   unlink "Op.stat.tmp";
  125.   open(foo, ">Op.stat.tmp");
  126.   
  127. --- 1,13 ----
  128.   #!./perl
  129.   
  130. ! # $RCSfile: stat.t,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:02:42 $
  131.   
  132.   print "1..56\n";
  133.   
  134.   chop($cwd = `pwd`);
  135.   
  136. + $DEV = `ls -l /dev`;
  137.   unlink "Op.stat.tmp";
  138.   open(foo, ">Op.stat.tmp");
  139.   
  140. ***************
  141. *** 81,96 ****
  142.   `rm -f Op.stat.tmp Op.stat.tmp2`;
  143.   if (! -e 'Op.stat.tmp') {print "ok 28\n";} else {print "not ok 28\n";}
  144.   
  145. ! if (-c '/dev/tty') {print "ok 29\n";} else {print "not ok 29\n";}
  146.   if (! -c '.') {print "ok 30\n";} else {print "not ok 30\n";}
  147.   
  148. ! if (! -e '/dev/printer' || -c '/dev/printer' || -S '/dev/printer')
  149.       {print "ok 31\n";}
  150.   else
  151.       {print "not ok 31\n";}
  152.   if (! -S '.') {print "ok 32\n";} else {print "not ok 32\n";}
  153.   
  154. ! if (! -e '/dev/mt0' || -b '/dev/mt0')
  155.       {print "ok 33\n";}
  156.   else
  157.       {print "not ok 33\n";}
  158. --- 83,107 ----
  159.   `rm -f Op.stat.tmp Op.stat.tmp2`;
  160.   if (! -e 'Op.stat.tmp') {print "ok 28\n";} else {print "not ok 28\n";}
  161.   
  162. ! if ($DEV !~ /\nc.* (\S+)\n/)
  163. !     {print "ok 29\n";}
  164. ! elsif (-c "/dev/$1")
  165. !     {print "ok 29\n";}
  166. ! else
  167. !     {print "not ok 29\n";}
  168.   if (! -c '.') {print "ok 30\n";} else {print "not ok 30\n";}
  169.   
  170. ! if ($DEV !~ /\ns.* (\S+)\n/)
  171.       {print "ok 31\n";}
  172. + elsif (-S "/dev/$1")
  173. +     {print "ok 31\n";}
  174.   else
  175.       {print "not ok 31\n";}
  176.   if (! -S '.') {print "ok 32\n";} else {print "not ok 32\n";}
  177.   
  178. ! if ($DEV !~ /\nb.* (\S+)\n/)
  179. !     {print "ok 33\n";}
  180. ! elsif (-b "/dev/$1")
  181.       {print "ok 33\n";}
  182.   else
  183.       {print "not ok 33\n";}
  184.  
  185. Index: str.c
  186. *** str.c.old    Fri Jun  7 12:26:55 1991
  187. --- str.c    Fri Jun  7 12:26:56 1991
  188. ***************
  189. *** 1,11 ****
  190. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:15:30 $
  191.    *
  192. !  *    Copyright (c) 1989, Larry Wall
  193.    *
  194. !  *    You may distribute under the terms of the GNU General Public License
  195. !  *    as specified in the README file that comes with the perl 3.0 kit.
  196.    *
  197.    * $Log:    str.c,v $
  198.    * Revision 4.0.1.1  91/04/12  09:15:30  lwall
  199.    * patch1: fixed undefined environ problem
  200.    * patch1: substr($ENV{"PATH"},0,0) = "/foo:" didn't modify environment
  201. --- 1,15 ----
  202. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:58:13 $
  203.    *
  204. !  *    Copyright (c) 1991, Larry Wall
  205.    *
  206. !  *    You may distribute under the terms of either the GNU General Public
  207. !  *    License or the Artistic License, as specified in the README file.
  208.    *
  209.    * $Log:    str.c,v $
  210. +  * Revision 4.0.1.2  91/06/07  11:58:13  lwall
  211. +  * patch4: new copyright notice
  212. +  * patch4: taint check on undefined string could cause core dump
  213. +  * 
  214.    * Revision 4.0.1.1  91/04/12  09:15:30  lwall
  215.    * patch1: fixed undefined environ problem
  216.    * patch1: substr($ENV{"PATH"},0,0) = "/foo:" didn't modify environment
  217. ***************
  218. *** 369,379 ****
  219.   STR *dstr;
  220.   register STR *sstr;
  221.   {
  222.   #ifdef TAINT
  223.       tainted |= sstr->str_tainted;
  224.   #endif
  225. -     if (!sstr)
  226. -     return;
  227.       if (!(sstr->str_pok))
  228.       (void)str_2ptr(sstr);
  229.       if (sstr)
  230. --- 373,383 ----
  231.   STR *dstr;
  232.   register STR *sstr;
  233.   {
  234. +     if (!sstr)
  235. +     return;
  236.   #ifdef TAINT
  237.       tainted |= sstr->str_tainted;
  238.   #endif
  239.       if (!(sstr->str_pok))
  240.       (void)str_2ptr(sstr);
  241.       if (sstr)
  242.  
  243. Index: x2p/str.c
  244. Prereq: 4.0
  245. *** x2p/str.c.old    Fri Jun  7 12:28:17 1991
  246. --- x2p/str.c    Fri Jun  7 12:28:17 1991
  247. ***************
  248. *** 1,11 ****
  249. ! /* $Header: str.c,v 4.0 91/03/20 01:58:15 lwall Locked $
  250.    *
  251. !  *    Copyright (c) 1989, Larry Wall
  252.    *
  253. !  *    You may distribute under the terms of the GNU General Public License
  254. !  *    as specified in the README file that comes with the perl 3.0 kit.
  255.    *
  256.    * $Log:    str.c,v $
  257.    * Revision 4.0  91/03/20  01:58:15  lwall
  258.    * 4.0 baseline.
  259.    * 
  260. --- 1,14 ----
  261. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:20:08 $
  262.    *
  263. !  *    Copyright (c) 1991, Larry Wall
  264.    *
  265. !  *    You may distribute under the terms of either the GNU General Public
  266. !  *    License or the Artistic License, as specified in the README file.
  267.    *
  268.    * $Log:    str.c,v $
  269. +  * Revision 4.0.1.1  91/06/07  12:20:08  lwall
  270. +  * patch4: new copyright notice
  271. +  * 
  272.    * Revision 4.0  91/03/20  01:58:15  lwall
  273.    * 4.0 baseline.
  274.    * 
  275.  
  276. Index: str.h
  277. *** str.h.old    Fri Jun  7 12:26:59 1991
  278. --- str.h    Fri Jun  7 12:27:01 1991
  279. ***************
  280. *** 1,11 ****
  281. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:16:12 $
  282.    *
  283. !  *    Copyright (c) 1989, Larry Wall
  284.    *
  285. !  *    You may distribute under the terms of the GNU General Public License
  286. !  *    as specified in the README file that comes with the perl 3.0 kit.
  287.    *
  288.    * $Log:    str.h,v $
  289.    * Revision 4.0.1.1  91/04/12  09:16:12  lwall
  290.    * patch1: you may now use "die" and "caller" in a signal handler
  291.    * 
  292. --- 1,14 ----
  293. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:58:33 $
  294.    *
  295. !  *    Copyright (c) 1991, Larry Wall
  296.    *
  297. !  *    You may distribute under the terms of either the GNU General Public
  298. !  *    License or the Artistic License, as specified in the README file.
  299.    *
  300.    * $Log:    str.h,v $
  301. +  * Revision 4.0.1.2  91/06/07  11:58:33  lwall
  302. +  * patch4: new copyright notice
  303. +  * 
  304.    * Revision 4.0.1.1  91/04/12  09:16:12  lwall
  305.    * patch1: you may now use "die" and "caller" in a signal handler
  306.    * 
  307.  
  308. Index: x2p/str.h
  309. Prereq: 4.0
  310. *** x2p/str.h.old    Fri Jun  7 12:28:20 1991
  311. --- x2p/str.h    Fri Jun  7 12:28:20 1991
  312. ***************
  313. *** 1,11 ****
  314. ! /* $Header: str.h,v 4.0 91/03/20 01:58:21 lwall Locked $
  315.    *
  316. !  *    Copyright (c) 1989, Larry Wall
  317.    *
  318. !  *    You may distribute under the terms of the GNU General Public License
  319. !  *    as specified in the README file that comes with the perl 3.0 kit.
  320.    *
  321.    * $Log:    str.h,v $
  322.    * Revision 4.0  91/03/20  01:58:21  lwall
  323.    * 4.0 baseline.
  324.    * 
  325. --- 1,14 ----
  326. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:20:22 $
  327.    *
  328. !  *    Copyright (c) 1991, Larry Wall
  329.    *
  330. !  *    You may distribute under the terms of either the GNU General Public
  331. !  *    License or the Artistic License, as specified in the README file.
  332.    *
  333.    * $Log:    str.h,v $
  334. +  * Revision 4.0.1.1  91/06/07  12:20:22  lwall
  335. +  * patch4: new copyright notice
  336. +  * 
  337.    * Revision 4.0  91/03/20  01:58:21  lwall
  338.    * 4.0 baseline.
  339.    * 
  340.  
  341. Index: hints/sunos_4_0_1.sh
  342. *** hints/sunos_4_0_1.sh.old    Fri Jun  7 12:24:51 1991
  343. --- hints/sunos_4_0_1.sh    Fri Jun  7 12:24:51 1991
  344. ***************
  345. *** 1,4 ****
  346. ! echo ': work around botch in SunOS 4.0.1 and 4.0.2'    >>../perl.h
  347. ! echo '#ifndef fputs'                    >>../perl.h
  348. ! echo '#define fputs(str,fp) fprintf(fp,"%s",str)'    >>../perl.h
  349. ! echo '#endif'                        >>../perl.h
  350. --- 1 ----
  351. ! $ccflags="$ccflags -DFPUTS_BOTCH"
  352.  
  353. Index: hints/sunos_4_0_2.sh
  354. *** hints/sunos_4_0_2.sh.old    Fri Jun  7 12:24:53 1991
  355. --- hints/sunos_4_0_2.sh    Fri Jun  7 12:24:54 1991
  356. ***************
  357. *** 1,4 ****
  358. ! echo ': work around botch in SunOS 4.0.1 and 4.0.2'    >>../perl.h
  359. ! echo '#ifndef fputs'                    >>../perl.h
  360. ! echo '#define fputs(str,fp) fprintf(fp,"%s",str)'    >>../perl.h
  361. ! echo '#endif'                        >>../perl.h
  362. --- 1 ----
  363. ! $ccflags="$ccflags -DFPUTS_BOTCH"
  364.  
  365. Index: hints/svr4.sh
  366. *** hints/svr4.sh.old    Fri Jun  7 12:24:56 1991
  367. --- hints/svr4.sh    Fri Jun  7 12:24:57 1991
  368. ***************
  369. *** 0 ****
  370. --- 1,6 ----
  371. + cc='/bin/cc'
  372. + test -f $cc || cc='/usr/ccs/bin/cc'
  373. + ldflags='-L/usr/ucblib'
  374. + mansrc='/usr/share/man/man1'
  375. + ccflags='-I/usr/include -I/usr/ucbinclude'
  376. + libswanted=`echo $libswanted | sed 's/ ucb/ c ucb/'`
  377.  
  378. Index: toke.c
  379. *** toke.c.old    Fri Jun  7 12:27:17 1991
  380. --- toke.c    Fri Jun  7 12:27:19 1991
  381. ***************
  382. *** 1,11 ****
  383. ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:18:18 $
  384.    *
  385. !  *    Copyright (c) 1989, Larry Wall
  386.    *
  387. !  *    You may distribute under the terms of the GNU General Public License
  388. !  *    as specified in the README file that comes with the perl 3.0 kit.
  389.    *
  390.    * $Log:    toke.c,v $
  391.    * Revision 4.0.1.1  91/04/12  09:18:18  lwall
  392.    * patch1: perl -de "print" wouldn't stop at the first statement
  393.    * 
  394. --- 1,17 ----
  395. ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 12:05:56 $
  396.    *
  397. !  *    Copyright (c) 1991, Larry Wall
  398.    *
  399. !  *    You may distribute under the terms of either the GNU General Public
  400. !  *    License or the Artistic License, as specified in the README file.
  401.    *
  402.    * $Log:    toke.c,v $
  403. +  * Revision 4.0.1.2  91/06/07  12:05:56  lwall
  404. +  * patch4: new copyright notice
  405. +  * patch4: debugger lost track of lines in eval
  406. +  * patch4: //o and s///o now optimize themselves fully at runtime
  407. +  * patch4: added global modifier for pattern matches
  408. +  * 
  409.    * Revision 4.0.1.1  91/04/12  09:18:18  lwall
  410.    * patch1: perl -de "print" wouldn't stop at the first statement
  411.    * 
  412. ***************
  413. *** 25,30 ****
  414. --- 31,40 ----
  415.   #include <sys/file.h>
  416.   #endif
  417.   
  418. + #ifdef f_next
  419. + #undef f_next
  420. + #endif
  421.   /* which backslash sequences to keep in m// or s// */
  422.   
  423.   static char *patleave = "\\.^$@dDwWsSbB+*?|()-nrtf0123456789[{]}";
  424. ***************
  425. *** 326,338 ****
  426.           s++;
  427.           if (s < d)
  428.           s++;
  429. -         if (perldb) {
  430. -         STR *str = Str_new(85,0);
  431. -         str_nset(str,linestr->str_ptr, s - linestr->str_ptr);
  432. -         astore(stab_xarray(curcmd->c_filestab),(int)curcmd->c_line,str);
  433. -         str_chop(linestr, s);
  434. -         }
  435.           if (in_format) {
  436.           bufptr = s;
  437.           yylval.formval = load_format();
  438. --- 336,341 ----
  439. ***************
  440. *** 947,953 ****
  441.       if (strEQ(d,"oct"))
  442.           UNI(O_OCT);
  443.       if (strEQ(d,"opendir"))
  444. !         FOP2(O_OPENDIR);
  445.       break;
  446.       case 'p': case 'P':
  447.       SNARFWORD;
  448. --- 950,956 ----
  449.       if (strEQ(d,"oct"))
  450.           UNI(O_OCT);
  451.       if (strEQ(d,"opendir"))
  452. !         FOP2(O_OPEN_DIR);
  453.       break;
  454.       case 'p': case 'P':
  455.       SNARFWORD;
  456. ***************
  457. *** 1417,1423 ****
  458.   }
  459.   
  460.   STR *
  461. ! scanconst(string,len)
  462.   char *string;
  463.   int len;
  464.   {
  465. --- 1420,1427 ----
  466.   }
  467.   
  468.   STR *
  469. ! scanconst(spat,string,len)
  470. ! SPAT *spat;
  471.   char *string;
  472.   int len;
  473.   {
  474. ***************
  475. *** 1425,1434 ****
  476.       register char *t;
  477.       register char *d;
  478.       register char *e;
  479.   
  480. !     if (index(string,'|')) {
  481.       return Nullstr;
  482. !     }
  483.       retstr = Str_new(86,len);
  484.       str_nset(retstr,string,len);
  485.       t = str_get(retstr);
  486. --- 1429,1441 ----
  487.       register char *t;
  488.       register char *d;
  489.       register char *e;
  490. +     char *origstring = string;
  491. +     static char *vert = "|";
  492.   
  493. !     if (ninstr(string, string+len, vert, vert+1))
  494.       return Nullstr;
  495. !     if (*string == '^')
  496. !     string++, len--;
  497.       retstr = Str_new(86,len);
  498.       str_nset(retstr,string,len);
  499.       t = str_get(retstr);
  500. ***************
  501. *** 1488,1493 ****
  502. --- 1495,1506 ----
  503.       }
  504.       *d = '\0';
  505.       retstr->str_cur = d - t;
  506. +     if (d == t+len)
  507. +     spat->spat_flags |= SPAT_ALL;
  508. +     if (*origstring != '^')
  509. +     spat->spat_flags |= SPAT_SCANFIRST;
  510. +     spat->spat_short = retstr;
  511. +     spat->spat_slen = d - t;
  512.       return retstr;
  513.   }
  514.   
  515. ***************
  516. *** 1526,1532 ****
  517.       return s;
  518.       }
  519.       s++;
  520. !     while (*s == 'i' || *s == 'o') {
  521.       if (*s == 'i') {
  522.           s++;
  523.           sawi = TRUE;
  524. --- 1539,1545 ----
  525.       return s;
  526.       }
  527.       s++;
  528. !     while (*s == 'i' || *s == 'o' || *s == 'g') {
  529.       if (*s == 'i') {
  530.           s++;
  531.           sawi = TRUE;
  532. ***************
  533. *** 1536,1541 ****
  534. --- 1549,1558 ----
  535.           s++;
  536.           spat->spat_flags |= SPAT_KEEP;
  537.       }
  538. +     if (*s == 'g') {
  539. +         s++;
  540. +         spat->spat_flags |= SPAT_GLOBAL;
  541. +     }
  542.       }
  543.       len = str->str_cur;
  544.       e = str->str_ptr + len;
  545. ***************
  546. *** 1575,1597 ****
  547.   #else
  548.       (void)bcopy((char *)spat, (char *)&savespat, sizeof(SPAT));
  549.   #endif
  550. !     if (*str->str_ptr == '^') {
  551. !     spat->spat_short = scanconst(str->str_ptr+1,len-1);
  552. !     if (spat->spat_short) {
  553. !         spat->spat_slen = spat->spat_short->str_cur;
  554. !         if (spat->spat_slen == len - 1)
  555. !         spat->spat_flags |= SPAT_ALL;
  556. !     }
  557. !     }
  558. !     else {
  559. !     spat->spat_flags |= SPAT_SCANFIRST;
  560. !     spat->spat_short = scanconst(str->str_ptr,len);
  561. !     if (spat->spat_short) {
  562. !         spat->spat_slen = spat->spat_short->str_cur;
  563. !         if (spat->spat_slen == len)
  564. !         spat->spat_flags |= SPAT_ALL;
  565. !     }
  566. !     }    
  567.       if ((spat->spat_flags & SPAT_ALL) && (spat->spat_flags & SPAT_SCANFIRST)) {
  568.       fbmcompile(spat->spat_short, spat->spat_flags & SPAT_FOLD);
  569.       spat->spat_regexp = regcomp(str->str_ptr,str->str_ptr+len,
  570. --- 1592,1598 ----
  571.   #else
  572.       (void)bcopy((char *)spat, (char *)&savespat, sizeof(SPAT));
  573.   #endif
  574. !     scanconst(spat,str->str_ptr,len);
  575.       if ((spat->spat_flags & SPAT_ALL) && (spat->spat_flags & SPAT_SCANFIRST)) {
  576.       fbmcompile(spat->spat_short, spat->spat_flags & SPAT_FOLD);
  577.       spat->spat_regexp = regcomp(str->str_ptr,str->str_ptr+len,
  578. ***************
  579. *** 1670,1686 ****
  580.           goto get_repl;        /* skip compiling for now */
  581.       }
  582.       }
  583. !     if (*str->str_ptr == '^') {
  584. !     spat->spat_short = scanconst(str->str_ptr+1,len-1);
  585. !     if (spat->spat_short)
  586. !         spat->spat_slen = spat->spat_short->str_cur;
  587. !     }
  588. !     else {
  589. !     spat->spat_flags |= SPAT_SCANFIRST;
  590. !     spat->spat_short = scanconst(str->str_ptr,len);
  591. !     if (spat->spat_short)
  592. !         spat->spat_slen = spat->spat_short->str_cur;
  593. !     }
  594.   get_repl:
  595.       s = scanstr(s);
  596.       if (s >= bufend) {
  597. --- 1671,1677 ----
  598.           goto get_repl;        /* skip compiling for now */
  599.       }
  600.       }
  601. !     scanconst(spat,str->str_ptr,len);
  602.   get_repl:
  603.       s = scanstr(s);
  604.       if (s >= bufend) {
  605. ***************
  606. *** 1690,1696 ****
  607.       return s;
  608.       }
  609.       spat->spat_repl = yylval.arg;
  610. -     spat->spat_flags |= SPAT_ONCE;
  611.       if ((spat->spat_repl[1].arg_type & A_MASK) == A_SINGLE)
  612.       spat->spat_flags |= SPAT_CONST;
  613.       else if ((spat->spat_repl[1].arg_type & A_MASK) == A_DOUBLE) {
  614. --- 1681,1686 ----
  615. ***************
  616. *** 1719,1725 ****
  617.       }
  618.       if (*s == 'g') {
  619.           s++;
  620. !         spat->spat_flags &= ~SPAT_ONCE;
  621.       }
  622.       if (*s == 'i') {
  623.           s++;
  624. --- 1709,1715 ----
  625.       }
  626.       if (*s == 'g') {
  627.           s++;
  628. !         spat->spat_flags |= SPAT_GLOBAL;
  629.       }
  630.       if (*s == 'i') {
  631.           s++;
  632. ***************
  633. *** 1751,1757 ****
  634.   hoistmust(spat)
  635.   register SPAT *spat;
  636.   {
  637. !     if (spat->spat_regexp->regmust) {    /* is there a better short-circuit? */
  638.       if (spat->spat_short &&
  639.         str_eq(spat->spat_short,spat->spat_regexp->regmust))
  640.       {
  641. --- 1741,1754 ----
  642.   hoistmust(spat)
  643.   register SPAT *spat;
  644.   {
  645. !     if (!spat->spat_short && spat->spat_regexp->regstart &&
  646. !     (!spat->spat_regexp->regmust || spat->spat_regexp->reganch & ROPT_ANCH)
  647. !        ) {
  648. !     spat->spat_short = spat->spat_regexp->regstart;
  649. !     if (!(spat->spat_regexp->reganch & ROPT_ANCH))
  650. !         spat->spat_flags |= SPAT_SCANFIRST;
  651. !     }
  652. !     else if (spat->spat_regexp->regmust) {/* is there a better short-circuit? */
  653.       if (spat->spat_short &&
  654.         str_eq(spat->spat_short,spat->spat_regexp->regmust))
  655.       {
  656. ***************
  657. *** 2119,2124 ****
  658. --- 2116,2122 ----
  659.           STR *tmpstr;
  660.           char *tmps;
  661.   
  662. +         CLINE;
  663.           multi_start = curcmd->c_line;
  664.           if (hereis)
  665.           multi_open = multi_close = '<';
  666.  
  667. Index: hints/ultrix_3.sh
  668. *** hints/ultrix_3.sh.old    Fri Jun  7 12:25:00 1991
  669. --- hints/ultrix_3.sh    Fri Jun  7 12:25:00 1991
  670. ***************
  671. *** 1,2 ****
  672.   ccflags="$ccflags -DLANGUAGE_C"
  673. ! d_waitpid=$undef
  674. --- 1,14 ----
  675.   ccflags="$ccflags -DLANGUAGE_C"
  676. ! tmp="`(uname -a) 2>/dev/null`"
  677. ! case "$tmp" in
  678. ! *3.[01]*RISC) d_waitpid=$undef;;
  679. ! '') d_waitpid=$undef;;
  680. ! esac
  681. ! case "$tmp" in
  682. ! *RISC)
  683. !     cmd_cflags='optimize="-g"'
  684. !     perl_cflags='optimize="-g"'
  685. !     tcmd_cflags='optimize="-g"'
  686. !     tperl_cflags='optimize="-g"'
  687. !     ;;
  688. ! esac
  689.  
  690. Index: hints/ultrix_4.sh
  691. *** hints/ultrix_4.sh.old    Fri Jun  7 12:25:02 1991
  692. --- hints/ultrix_4.sh    Fri Jun  7 12:25:03 1991
  693. ***************
  694. *** 1 ****
  695. --- 1,19 ----
  696.   ccflags="$ccflags -DLANGUAGE_C -Olimit 2900"
  697. + tmp=`(uname -a) 2>/dev/null`
  698. + case "$tmp" in
  699. + *RISC*) cat <<EOF
  700. + Note that there is a bug in some versions of NFS on the DECStation that
  701. + may cause utime() to work incorrectly.  If so, regression test io/fs
  702. + may fail if run under NFS.  Ignore the failure.
  703. + EOF
  704. + ;;
  705. + esac
  706. + case "$tmp" in
  707. + *4.1*)
  708. +     eval_cflags='optimize="-g"'
  709. +     teval_cflags='optimize="-g"'
  710. +     toke_cflags='optimize="-g"'
  711. +     ttoke_cflags='optimize="-g"'
  712. +     ;;
  713. + esac
  714.  
  715. Index: util.c
  716. *** util.c.old    Fri Jun  7 12:27:26 1991
  717. --- util.c    Fri Jun  7 12:27:27 1991
  718. ***************
  719. *** 1,11 ****
  720. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.1 $$Date: 91/04/12 09:19:25 $
  721.    *
  722. !  *    Copyright (c) 1989, Larry Wall
  723.    *
  724. !  *    You may distribute under the terms of the GNU General Public License
  725. !  *    as specified in the README file that comes with the perl 3.0 kit.
  726.    *
  727.    * $Log:    util.c,v $
  728.    * Revision 4.0.1.1  91/04/12  09:19:25  lwall
  729.    * patch1: random cleanup in cpp namespace
  730.    * 
  731. --- 1,18 ----
  732. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 12:10:42 $
  733.    *
  734. !  *    Copyright (c) 1991, Larry Wall
  735.    *
  736. !  *    You may distribute under the terms of either the GNU General Public
  737. !  *    License or the Artistic License, as specified in the README file.
  738.    *
  739.    * $Log:    util.c,v $
  740. +  * Revision 4.0.1.2  91/06/07  12:10:42  lwall
  741. +  * patch4: new copyright notice
  742. +  * patch4: made some allowances for "semi-standard" C
  743. +  * patch4: index() could blow up searching for null string
  744. +  * patch4: taintchecks could improperly modify parent in vfork()
  745. +  * patch4: exec would close files even if you cleared close-on-exec flag
  746. +  * 
  747.    * Revision 4.0.1.1  91/04/12  09:19:25  lwall
  748.    * patch1: random cleanup in cpp namespace
  749.    * 
  750. ***************
  751. *** 60,68 ****
  752.   #endif /* MSDOS */
  753.   {
  754.       char *ptr;
  755. ! #ifndef __STDC__
  756.       char *malloc();
  757. ! #endif /* ! __STDC__ */
  758.   
  759.   #ifdef MSDOS
  760.       if (size > 0xffff) {
  761. --- 67,75 ----
  762.   #endif /* MSDOS */
  763.   {
  764.       char *ptr;
  765. ! #ifndef STANDARD_C
  766.       char *malloc();
  767. ! #endif /* ! STANDARD_C */
  768.   
  769.   #ifdef MSDOS
  770.       if (size > 0xffff) {
  771. ***************
  772. *** 108,116 ****
  773.   #endif /* MSDOS */
  774.   {
  775.       char *ptr;
  776. ! #ifndef __STDC__
  777.       char *realloc();
  778. ! #endif /* ! __STDC__ */
  779.   
  780.   #ifdef MSDOS
  781.       if (size > 0xffff) {
  782. --- 115,123 ----
  783.   #endif /* MSDOS */
  784.   {
  785.       char *ptr;
  786. ! #ifndef STANDARD_C
  787.       char *realloc();
  788. ! #endif /* ! STANDARD_C */
  789.   
  790.   #ifdef MSDOS
  791.       if (size > 0xffff) {
  792. ***************
  793. *** 514,522 ****
  794.       register unsigned char *oldlittle;
  795.   
  796.   #ifndef lint
  797. !     if (!(littlestr->str_pok & SP_FBM))
  798.       return ninstr((char*)big,(char*)bigend,
  799.           littlestr->str_ptr, littlestr->str_ptr + littlestr->str_cur);
  800.   #endif
  801.   
  802.       littlelen = littlestr->str_cur;
  803. --- 521,532 ----
  804.       register unsigned char *oldlittle;
  805.   
  806.   #ifndef lint
  807. !     if (!(littlestr->str_pok & SP_FBM)) {
  808. !     if (!littlestr->str_ptr)
  809. !         return (char*)big;
  810.       return ninstr((char*)big,(char*)bigend,
  811.           littlestr->str_ptr, littlestr->str_ptr + littlestr->str_cur);
  812. +     }
  813.   #endif
  814.   
  815.       littlelen = littlestr->str_cur;
  816. ***************
  817. *** 851,861 ****
  818. --- 861,873 ----
  819.   {
  820.       char *pat;
  821.       char *s;
  822. + #ifndef HAS_VPRINTF
  823.   #ifdef CHARVSPRINTF
  824.       char *vsprintf();
  825.   #else
  826.       int vsprintf();
  827.   #endif
  828. + #endif
  829.   
  830.       s = buf;
  831.   #ifdef lint
  832. ***************
  833. *** 1196,1201 ****
  834. --- 1208,1219 ----
  835.       return Nullfp;
  836.       this = (*mode == 'w');
  837.       that = !this;
  838. + #ifdef TAINT
  839. +     if (doexec) {
  840. +     taintenv();
  841. +     taintproper("Insecure dependency in exec");
  842. +     }
  843. + #endif
  844.       while ((pid = (doexec?vfork():fork())) < 0) {
  845.       if (errno != EAGAIN) {
  846.           close(p[this]);
  847. ***************
  848. *** 1214,1226 ****
  849.           close(p[THIS]);
  850.       }
  851.       if (doexec) {
  852. ! #if !defined(I_FCNTL) || !defined(F_SETFD)
  853.           int fd;
  854.   
  855.   #ifndef NOFILE
  856.   #define NOFILE 20
  857.   #endif
  858. !         for (fd = 3; fd < NOFILE; fd++)
  859.           close(fd);
  860.   #endif
  861.           do_exec(cmd);    /* may or may not use the shell */
  862. --- 1232,1244 ----
  863.           close(p[THIS]);
  864.       }
  865.       if (doexec) {
  866. ! #if !defined(HAS_FCNTL) || !defined(F_SETFD)
  867.           int fd;
  868.   
  869.   #ifndef NOFILE
  870.   #define NOFILE 20
  871.   #endif
  872. !         for (fd = maxsysfd + 1; fd < NOFILE; fd++)
  873.           close(fd);
  874.   #endif
  875.           do_exec(cmd);    /* may or may not use the shell */
  876. ***************
  877. *** 1273,1279 ****
  878.       close(newfd);
  879.       fcntl(oldfd, F_DUPFD, newfd);
  880.   #else
  881. !     int fdtmp[20];
  882.       int fdx = 0;
  883.       int fd;
  884.   
  885. --- 1291,1297 ----
  886.       close(newfd);
  887.       fcntl(oldfd, F_DUPFD, newfd);
  888.   #else
  889. !     int fdtmp[256];
  890.       int fdx = 0;
  891.       int fd;
  892.   
  893.  
  894. Index: x2p/util.c
  895. Prereq: 4.0
  896. *** x2p/util.c.old    Fri Jun  7 12:28:22 1991
  897. --- x2p/util.c    Fri Jun  7 12:28:23 1991
  898. ***************
  899. *** 1,11 ****
  900. ! /* $Header: util.c,v 4.0 91/03/20 01:58:25 lwall Locked $
  901.    *
  902. !  *    Copyright (c) 1989, Larry Wall
  903.    *
  904. !  *    You may distribute under the terms of the GNU General Public License
  905. !  *    as specified in the README file that comes with the perl 3.0 kit.
  906.    *
  907.    * $Log:    util.c,v $
  908.    * Revision 4.0  91/03/20  01:58:25  lwall
  909.    * 4.0 baseline.
  910.    * 
  911. --- 1,14 ----
  912. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:20:35 $
  913.    *
  914. !  *    Copyright (c) 1991, Larry Wall
  915.    *
  916. !  *    You may distribute under the terms of either the GNU General Public
  917. !  *    License or the Artistic License, as specified in the README file.
  918.    *
  919.    * $Log:    util.c,v $
  920. +  * Revision 4.0.1.1  91/06/07  12:20:35  lwall
  921. +  * patch4: new copyright notice
  922. +  * 
  923.    * Revision 4.0  91/03/20  01:58:25  lwall
  924.    * 4.0 baseline.
  925.    * 
  926.  
  927. Index: util.h
  928. Prereq: 4.0
  929. *** util.h.old    Fri Jun  7 12:27:31 1991
  930. --- util.h    Fri Jun  7 12:27:32 1991
  931. ***************
  932. *** 1,11 ****
  933. ! /* $Header: util.h,v 4.0 91/03/20 01:56:48 lwall Locked $
  934.    *
  935. !  *    Copyright (c) 1989, Larry Wall
  936.    *
  937. !  *    You may distribute under the terms of the GNU General Public License
  938. !  *    as specified in the README file that comes with the perl 3.0 kit.
  939.    *
  940.    * $Log:    util.h,v $
  941.    * Revision 4.0  91/03/20  01:56:48  lwall
  942.    * 4.0 baseline.
  943.    * 
  944. --- 1,14 ----
  945. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:11:00 $
  946.    *
  947. !  *    Copyright (c) 1991, Larry Wall
  948.    *
  949. !  *    You may distribute under the terms of either the GNU General Public
  950. !  *    License or the Artistic License, as specified in the README file.
  951.    *
  952.    * $Log:    util.h,v $
  953. +  * Revision 4.0.1.1  91/06/07  12:11:00  lwall
  954. +  * patch4: new copyright notice
  955. +  * 
  956.    * Revision 4.0  91/03/20  01:56:48  lwall
  957.    * 4.0 baseline.
  958.    * 
  959.  
  960. Index: x2p/util.h
  961. Prereq: 4.0
  962. *** x2p/util.h.old    Fri Jun  7 12:28:25 1991
  963. --- x2p/util.h    Fri Jun  7 12:28:26 1991
  964. ***************
  965. *** 1,11 ****
  966. ! /* $Header: util.h,v 4.0 91/03/20 01:58:29 lwall Locked $
  967.    *
  968. !  *    Copyright (c) 1989, Larry Wall
  969.    *
  970. !  *    You may distribute under the terms of the GNU General Public License
  971. !  *    as specified in the README file that comes with the perl 3.0 kit.
  972.    *
  973.    * $Log:    util.h,v $
  974.    * Revision 4.0  91/03/20  01:58:29  lwall
  975.    * 4.0 baseline.
  976.    * 
  977. --- 1,14 ----
  978. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:20:43 $
  979.    *
  980. !  *    Copyright (c) 1991, Larry Wall
  981.    *
  982. !  *    You may distribute under the terms of either the GNU General Public
  983. !  *    License or the Artistic License, as specified in the README file.
  984.    *
  985.    * $Log:    util.h,v $
  986. +  * Revision 4.0.1.1  91/06/07  12:20:43  lwall
  987. +  * patch4: new copyright notice
  988. +  * 
  989.    * Revision 4.0  91/03/20  01:58:29  lwall
  990.    * 4.0 baseline.
  991.    * 
  992.  
  993. Index: hints/vax.sh
  994. *** hints/vax.sh.old    Fri Jun  7 12:25:04 1991
  995. --- hints/vax.sh    Fri Jun  7 12:25:05 1991
  996. ***************
  997. *** 0 ****
  998. --- 1 ----
  999. + teval_cflags='case $cc in *gcc);; *) optimize="-O";; esac'
  1000.  
  1001. Index: x2p/walk.c
  1002. Prereq: 4.0
  1003. *** x2p/walk.c.old    Fri Jun  7 12:28:29 1991
  1004. --- x2p/walk.c    Fri Jun  7 12:28:30 1991
  1005. ***************
  1006. *** 1,11 ****
  1007. ! /* $Header: walk.c,v 4.0 91/03/20 01:58:36 lwall Locked $
  1008.    *
  1009. !  *    Copyright (c) 1989, Larry Wall
  1010.    *
  1011. !  *    You may distribute under the terms of the GNU General Public License
  1012. !  *    as specified in the README file that comes with the perl 3.0 kit.
  1013.    *
  1014.    * $Log:    walk.c,v $
  1015.    * Revision 4.0  91/03/20  01:58:36  lwall
  1016.    * 4.0 baseline.
  1017.    * 
  1018. --- 1,15 ----
  1019. ! /* $RCSfile: walk.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:22:04 $
  1020.    *
  1021. !  *    Copyright (c) 1991, Larry Wall
  1022.    *
  1023. !  *    You may distribute under the terms of either the GNU General Public
  1024. !  *    License or the Artistic License, as specified in the README file.
  1025.    *
  1026.    * $Log:    walk.c,v $
  1027. +  * Revision 4.0.1.1  91/06/07  12:22:04  lwall
  1028. +  * patch4: new copyright notice
  1029. +  * patch4: a2p didn't correctly implement -n switch
  1030. +  * 
  1031.    * Revision 4.0  91/03/20  01:58:36  lwall
  1032.    * 4.0 baseline.
  1033.    * 
  1034. ***************
  1035. *** 22,27 ****
  1036. --- 26,32 ----
  1037.   bool subretnum = FALSE;
  1038.   bool saw_FNR = FALSE;
  1039.   bool saw_argv0 = FALSE;
  1040. + bool saw_fh = FALSE;
  1041.   int maxtmp = 0;
  1042.   char *lparen;
  1043.   char *rparen;
  1044. ***************
  1045. *** 60,65 ****
  1046. --- 65,84 ----
  1047.       type &= 255;
  1048.       switch (type) {
  1049.       case OPROG:
  1050. +     arymax = 0;
  1051. +     if (namelist) {
  1052. +         while (isalpha(*namelist)) {
  1053. +         for (d = tokenbuf,s=namelist;
  1054. +           isalpha(*s) || isdigit(*s) || *s == '_';
  1055. +           *d++ = *s++) ;
  1056. +         *d = '\0';
  1057. +         while (*s && !isalpha(*s)) s++;
  1058. +         namelist = s;
  1059. +         nameary[++arymax] = savestr(tokenbuf);
  1060. +         }
  1061. +     }
  1062. +     if (maxfld < arymax)
  1063. +         maxfld = arymax;
  1064.       opens = str_new(0);
  1065.       subs = str_new(0);
  1066.       str = walk(0,level,ops[node+1].ival,&numarg,P_MIN);
  1067. ***************
  1068. *** 115,134 ****
  1069.           str_cat(str,"chop;\t# strip record separator\n");
  1070.           tab(str,level);
  1071.           }
  1072. -         arymax = 0;
  1073. -         if (namelist) {
  1074. -         while (isalpha(*namelist)) {
  1075. -             for (d = tokenbuf,s=namelist;
  1076. -               isalpha(*s) || isdigit(*s) || *s == '_';
  1077. -               *d++ = *s++) ;
  1078. -             *d = '\0';
  1079. -             while (*s && !isalpha(*s)) s++;
  1080. -             namelist = s;
  1081. -             nameary[++arymax] = savestr(tokenbuf);
  1082. -         }
  1083. -         }
  1084. -         if (maxfld < arymax)
  1085. -         maxfld = arymax;
  1086.           if (do_split)
  1087.           emit_split(str,level);
  1088.           str_scat(str,fstr);
  1089. --- 134,139 ----
  1090. ***************
  1091. *** 584,594 ****
  1092.           s = savestr(tokenbuf);
  1093.           for (t = tokenbuf; *t; t++) {
  1094.               *t &= 127;
  1095.               if (!isalpha(*t) && !isdigit(*t))
  1096.               *t = '_';
  1097.           }
  1098.           if (!index(tokenbuf,'_'))
  1099. !             strcpy(t,"_fh");
  1100.           tmp3str = hfetch(symtab,tokenbuf);
  1101.           if (!tmp3str) {
  1102.               do_opens = TRUE;
  1103. --- 589,601 ----
  1104.           s = savestr(tokenbuf);
  1105.           for (t = tokenbuf; *t; t++) {
  1106.               *t &= 127;
  1107. +             if (islower(*t))
  1108. +             *t = toupper(*t);
  1109.               if (!isalpha(*t) && !isdigit(*t))
  1110.               *t = '_';
  1111.           }
  1112.           if (!index(tokenbuf,'_'))
  1113. !             strcpy(t,"_FH");
  1114.           tmp3str = hfetch(symtab,tokenbuf);
  1115.           if (!tmp3str) {
  1116.               do_opens = TRUE;
  1117. ***************
  1118. *** 1110,1120 ****
  1119.           s = savestr(tokenbuf);
  1120.           for (t = tokenbuf; *t; t++) {
  1121.           *t &= 127;
  1122.           if (!isalpha(*t) && !isdigit(*t))
  1123.               *t = '_';
  1124.           }
  1125.           if (!index(tokenbuf,'_'))
  1126. !         strcpy(t,"_fh");
  1127.           str_free(tmpstr);
  1128.           safefree(s);
  1129.           str_set(str,"close ");
  1130. --- 1117,1129 ----
  1131.           s = savestr(tokenbuf);
  1132.           for (t = tokenbuf; *t; t++) {
  1133.           *t &= 127;
  1134. +         if (islower(*t))
  1135. +             *t = toupper(*t);
  1136.           if (!isalpha(*t) && !isdigit(*t))
  1137.               *t = '_';
  1138.           }
  1139.           if (!index(tokenbuf,'_'))
  1140. !         strcpy(t,"_FH");
  1141.           str_free(tmpstr);
  1142.           safefree(s);
  1143.           str_set(str,"close ");
  1144. ***************
  1145. *** 1145,1155 ****
  1146.           s = savestr(tokenbuf);
  1147.           for (t = tokenbuf; *t; t++) {
  1148.               *t &= 127;
  1149.               if (!isalpha(*t) && !isdigit(*t))
  1150.               *t = '_';
  1151.           }
  1152.           if (!index(tokenbuf,'_'))
  1153. !             strcpy(t,"_fh");
  1154.           tmp3str = hfetch(symtab,tokenbuf);
  1155.           if (!tmp3str) {
  1156.               str_cat(opens,"open(");
  1157. --- 1154,1166 ----
  1158.           s = savestr(tokenbuf);
  1159.           for (t = tokenbuf; *t; t++) {
  1160.               *t &= 127;
  1161. +             if (islower(*t))
  1162. +             *t = toupper(*t);
  1163.               if (!isalpha(*t) && !isdigit(*t))
  1164.               *t = '_';
  1165.           }
  1166.           if (!index(tokenbuf,'_'))
  1167. !             strcpy(t,"_FH");
  1168.           tmp3str = hfetch(symtab,tokenbuf);
  1169.           if (!tmp3str) {
  1170.               str_cat(opens,"open(");
  1171. ***************
  1172. *** 1195,1203 ****
  1173.           str_cat(str,"printf");
  1174.       else
  1175.           str_cat(str,"print");
  1176.       if (len == 3 || do_fancy_opens) {
  1177. !         if (*tokenbuf)
  1178.           str_cat(str," ");
  1179.           str_cat(str,tokenbuf);
  1180.       }
  1181.       tmpstr = walk(1+(type==OPRINT),level,ops[node+1].ival,&numarg,P_MIN);
  1182. --- 1206,1217 ----
  1183.           str_cat(str,"printf");
  1184.       else
  1185.           str_cat(str,"print");
  1186. +     saw_fh = 0;
  1187.       if (len == 3 || do_fancy_opens) {
  1188. !         if (*tokenbuf) {
  1189.           str_cat(str," ");
  1190. +         saw_fh = 1;
  1191. +         }
  1192.           str_cat(str,tokenbuf);
  1193.       }
  1194.       tmpstr = walk(1+(type==OPRINT),level,ops[node+1].ival,&numarg,P_MIN);
  1195. ***************
  1196. *** 1224,1230 ****
  1197.       }
  1198.       if (*tmpstr->str_ptr) {
  1199.           str_cat(str," ");
  1200. !         str_scat(str,tmpstr);
  1201.       }
  1202.       else {
  1203.           str_cat(str," $_");
  1204. --- 1238,1250 ----
  1205.       }
  1206.       if (*tmpstr->str_ptr) {
  1207.           str_cat(str," ");
  1208. !         if (!saw_fh && *tmpstr->str_ptr == '(') {
  1209. !         str_cat(str,"(");
  1210. !         str_scat(str,tmpstr);
  1211. !         str_cat(str,")");
  1212. !         }
  1213. !         else
  1214. !         str_scat(str,tmpstr);
  1215.       }
  1216.       else {
  1217.           str_cat(str," $_");
  1218.  
  1219. Index: x2p/Makefile.SH
  1220. Prereq: 4.0
  1221. *** x2p/Makefile.SH.old    Fri Jun  7 12:27:40 1991
  1222. --- x2p/Makefile.SH    Fri Jun  7 12:27:41 1991
  1223. ***************
  1224. *** 19,27 ****
  1225.   esac
  1226.   echo "Extracting x2p/Makefile (with variable substitutions)"
  1227.   cat >Makefile <<!GROK!THIS!
  1228. ! # $Header: Makefile.SH,v 4.0 91/03/20 01:57:03 lwall Locked $
  1229.   #
  1230.   # $Log:    Makefile.SH,v $
  1231.   # Revision 4.0  91/03/20  01:57:03  lwall
  1232.   # 4.0 baseline.
  1233.   # 
  1234. --- 19,30 ----
  1235.   esac
  1236.   echo "Extracting x2p/Makefile (with variable substitutions)"
  1237.   cat >Makefile <<!GROK!THIS!
  1238. ! # $RCSfile: Makefile.SH,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:12:14 $
  1239.   #
  1240.   # $Log:    Makefile.SH,v $
  1241. + # Revision 4.0.1.1  91/06/07  12:12:14  lwall
  1242. + # patch4: cflags now emits entire cc command except for the filename
  1243. + # 
  1244.   # Revision 4.0  91/03/20  01:57:03  lwall
  1245.   # 4.0 baseline.
  1246.   # 
  1247. ***************
  1248. *** 33,39 ****
  1249.   lib = $lib
  1250.   mansrc = $mansrc
  1251.   manext = $manext
  1252. - CFLAGS = $ccflags $optimize
  1253.   LDFLAGS = $ldflags
  1254.   SMALL = $small
  1255.   LARGE = $large $split
  1256. --- 36,41 ----
  1257. ***************
  1258. *** 45,50 ****
  1259. --- 47,54 ----
  1260.   
  1261.   cat >>Makefile <<'!NO!SUBS!'
  1262.   
  1263. + CCCMD = `sh cflags $@`
  1264.   public = a2p s2p find2perl
  1265.   
  1266.   private = 
  1267. ***************
  1268. *** 69,81 ****
  1269.   SHELL = /bin/sh
  1270.   
  1271.   .c.o:
  1272. !     $(CC) -c $(CFLAGS) $(LARGE) $*.c
  1273.   
  1274.   all: $(public) $(private) $(util)
  1275.       touch all
  1276.   
  1277.   a2p: $(obj) a2p.o
  1278. !     $(CC) $(LARGE) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
  1279.   
  1280.   a2p.c: a2p.y
  1281.       @ echo Expect 226 shift/reduce conflicts...
  1282. --- 73,85 ----
  1283.   SHELL = /bin/sh
  1284.   
  1285.   .c.o:
  1286. !     $(CCCMD) $*.c
  1287.   
  1288.   all: $(public) $(private) $(util)
  1289.       touch all
  1290.   
  1291.   a2p: $(obj) a2p.o
  1292. !     $(CC) $(LDFLAGS) $(obj) a2p.o $(libs) -o a2p
  1293.   
  1294.   a2p.c: a2p.y
  1295.       @ echo Expect 226 shift/reduce conflicts...
  1296. ***************
  1297. *** 83,89 ****
  1298.       mv y.tab.c a2p.c
  1299.   
  1300.   a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
  1301. !     $(CC) -c $(CFLAGS) $(LARGE) a2p.c
  1302.   
  1303.   install: a2p s2p
  1304.   # won't work with csh
  1305. --- 87,93 ----
  1306.       mv y.tab.c a2p.c
  1307.   
  1308.   a2p.o: a2p.c a2py.c a2p.h EXTERN.h util.h INTERN.h handy.h ../config.h str.h hash.h
  1309. !     $(CCCMD) $(LARGE) a2p.c
  1310.   
  1311.   install: a2p s2p
  1312.   # won't work with csh
  1313. ***************
  1314. *** 95,110 ****
  1315.   for pub in $(public); do \
  1316.   chmod +x `basename $$pub`; \
  1317.   done
  1318. - #    chmod +x makedir
  1319. - #    - ./makedir `filexp $(lib)`
  1320. - #    - \
  1321. - #if test `pwd` != `filexp $(lib)`; then \
  1322. - #cp $(private) `filexp $(lib)`; \
  1323. - #fi
  1324. - #    cd `filexp $(lib)`; \
  1325. - #for priv in $(private); do \
  1326. - #chmod +x `basename $$priv`; \
  1327. - #done
  1328.       - if test `pwd` != $(mansrc); then \
  1329.   for page in $(manpages); do \
  1330.   cp $$page $(mansrc)/`basename $$page .man`.$(manext); \
  1331. --- 99,104 ----
  1332. ***************
  1333. *** 115,121 ****
  1334.       rm -f a2p *.o
  1335.   
  1336.   realclean: clean
  1337. !     rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p all
  1338.   
  1339.   # The following lint has practically everything turned on.  Unfortunately,
  1340.   # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  1341. --- 109,115 ----
  1342.       rm -f a2p *.o
  1343.   
  1344.   realclean: clean
  1345. !     rm -f *.orig */*.orig core $(addedbyconf) a2p.c s2p find2perl all cflags
  1346.   
  1347.   # The following lint has practically everything turned on.  Unfortunately,
  1348.   # you have to wade through a lot of mumbo jumbo that can't be suppressed.
  1349.  
  1350. Index: README
  1351. *** README.old    Fri Jun  7 12:22:37 1991
  1352. --- README    Fri Jun  7 12:22:38 1991
  1353. ***************
  1354. *** 2,27 ****
  1355.               Perl Kit, Version 4.0
  1356.   
  1357.           Copyright (c) 1989,1990,1991, Larry Wall
  1358.   
  1359.       This program is free software; you can redistribute it and/or modify
  1360. !     it under the terms of the GNU General Public License as published by
  1361. !     the Free Software Foundation; either version 1, or (at your option)
  1362. !     any later version.
  1363.   
  1364.       This program is distributed in the hope that it will be useful,
  1365.       but WITHOUT ANY WARRANTY; without even the implied warranty of
  1366. !     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1367. !     GNU General Public License for more details.
  1368.   
  1369. !     You should have received a copy of the GNU General Public License
  1370.       along with this program; if not, write to the Free Software
  1371.       Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1372.   
  1373. !     My interpretation of the GNU General Public License is that no Perl
  1374. !     script falls under the terms of the License unless you explicitly put
  1375. !     said script under the terms of the License yourself.  Furthermore, any
  1376.       object code linked with uperl.o does not automatically fall under the
  1377. !     terms of the License, provided such object code only adds definitions
  1378.       of subroutines and variables, and does not otherwise impair the
  1379.       resulting interpreter from executing any standard Perl script.  I
  1380.       consider linking in C subroutines in this manner to be the moral
  1381. --- 2,36 ----
  1382.               Perl Kit, Version 4.0
  1383.   
  1384.           Copyright (c) 1989,1990,1991, Larry Wall
  1385. +               All rights reserved.
  1386.   
  1387.       This program is free software; you can redistribute it and/or modify
  1388. !     it under the terms of either:
  1389. !     
  1390. !     a) the GNU General Public License as published by the Free
  1391. !     Software Foundation; either version 1, or (at your option) any
  1392. !     later version, or
  1393.   
  1394. +     b) the "Artistic License" which comes with this Kit.
  1395.       This program is distributed in the hope that it will be useful,
  1396.       but WITHOUT ANY WARRANTY; without even the implied warranty of
  1397. !     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See either
  1398. !     the GNU General Public License or the Artistic License for more details.
  1399.   
  1400. !     You should have received a copy of the Artistic License with this
  1401. !     Kit, in the file named "Artistic".  If not, I'll be glad to provide one.
  1402. !     You should also have received a copy of the GNU General Public License
  1403.       along with this program; if not, write to the Free Software
  1404.       Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1405.   
  1406. !     For those of you that choose to use the GNU General Public License,
  1407. !     my interpretation of the GNU General Public License is that no Perl
  1408. !     script falls under the terms of the GPL unless you explicitly put
  1409. !     said script under the terms of the GPL yourself.  Furthermore, any
  1410.       object code linked with uperl.o does not automatically fall under the
  1411. !     terms of the GPL, provided such object code only adds definitions
  1412.       of subroutines and variables, and does not otherwise impair the
  1413.       resulting interpreter from executing any standard Perl script.  I
  1414.       consider linking in C subroutines in this manner to be the moral
  1415. ***************
  1416. *** 31,46 ****
  1417.       Public License.  (This is merely an alternate way of specifying input
  1418.       to the program.)  You may also sell a binary produced by the dumping of
  1419.       a running Perl script that belongs to you, provided that you provide or
  1420. !     offer to provide the Perl source as specified by the License.  (The
  1421.       fact that a Perl interpreter and your code are in the same binary file
  1422.       is, in this case, a form of mere aggregation.)  This is my interpretation
  1423. !     of the License.  If you still have concerns or difficulties understanding
  1424. !     my intent, feel free to contact me.
  1425.   
  1426.   --------------------------------------------------------------------------
  1427.   
  1428.   Perl is a language that combines some of the features of C, sed, awk and shell.
  1429. ! See the manual page for more hype.
  1430.   
  1431.   Perl will probably not run on machines with a small address space.
  1432.   
  1433. --- 40,58 ----
  1434.       Public License.  (This is merely an alternate way of specifying input
  1435.       to the program.)  You may also sell a binary produced by the dumping of
  1436.       a running Perl script that belongs to you, provided that you provide or
  1437. !     offer to provide the Perl source as specified by the GPL.  (The
  1438.       fact that a Perl interpreter and your code are in the same binary file
  1439.       is, in this case, a form of mere aggregation.)  This is my interpretation
  1440. !     of the GPL.  If you still have concerns or difficulties understanding
  1441. !     my intent, feel free to contact me.  Of course, the Artistic License
  1442. !     spells all this out for your protection, so you may prefer to use that.
  1443.   
  1444.   --------------------------------------------------------------------------
  1445.   
  1446.   Perl is a language that combines some of the features of C, sed, awk and shell.
  1447. ! See the manual page for more hype.  There's also a Nutshell Handbook published
  1448. ! by O'Reilly & Assoc.  Their U.S. number is 1-800-338-6887 (dev-nuts) and
  1449. ! their international number is 1-707-829-0515.  E-mail to nuts@ora.com.
  1450.   
  1451.   Perl will probably not run on machines with a small address space.
  1452.   
  1453. ***************
  1454. *** 107,113 ****
  1455.       AIX/RT may need a -a switch and -DCRIPPLED_CC.
  1456.       AIX RS/6000 needs to use system malloc and avoid -O on eval.c and toke.c.
  1457.       AIX RS/6000 needs -D_NO_PROTO.
  1458. !     SUNOS 4.0.[12] needs #define fputs(str,fp) fprintf(fp,"%s",str) in perl.h
  1459.       SUNOS 3.[45] should use the system malloc.
  1460.       SGI machines may need -Ddouble="long float" and -O1.
  1461.       Vax-based systems may need to hand assemble teval.s with a -J switch.
  1462. --- 119,125 ----
  1463.       AIX/RT may need a -a switch and -DCRIPPLED_CC.
  1464.       AIX RS/6000 needs to use system malloc and avoid -O on eval.c and toke.c.
  1465.       AIX RS/6000 needs -D_NO_PROTO.
  1466. !     SUNOS 4.0.[12] needs -DFPUTS_BOTCH.
  1467.       SUNOS 3.[45] should use the system malloc.
  1468.       SGI machines may need -Ddouble="long float" and -O1.
  1469.       Vax-based systems may need to hand assemble teval.s with a -J switch.
  1470. ***************
  1471. *** 114,119 ****
  1472. --- 126,132 ----
  1473.       Ultrix on MIPS machines may need -DLANGUAGE_C.
  1474.       Ultrix 4.0 on MIPS machines may need -Olimit 2900 or so.
  1475.       Ultrix 3.[01] on MIPS needs to undefine WAITPID--the system call is busted.
  1476. +     MIPS machines need /bin before /bsd43/bin in PATH.
  1477.       MIPS machines may need to undef d_volatile.
  1478.       MIPS machines may need to turn off -O on cmd.c, perl.c and tperl.c.
  1479.       Some MIPS machines may need to undefine CASTNEGFLOAT.
  1480. ***************
  1481. *** 164,170 ****
  1482.   
  1483.       If possible, send in patches such that the patch program will apply them.
  1484.       Context diffs are the best, then normal diffs.  Don't send ed scripts--
  1485. !     I've probably changed my copy since the version you have.
  1486.   
  1487.       Watch for perl patches in comp.lang.perl.  Patches will generally be
  1488.       in a form usable by the patch program.  If you are just now bringing up
  1489. --- 177,184 ----
  1490.   
  1491.       If possible, send in patches such that the patch program will apply them.
  1492.       Context diffs are the best, then normal diffs.  Don't send ed scripts--
  1493. !     I've probably changed my copy since the version you have.  It's also
  1494. !     helpful if you send the output of "uname -a".
  1495.   
  1496.       Watch for perl patches in comp.lang.perl.  Patches will generally be
  1497.       in a form usable by the patch program.  If you are just now bringing up
  1498.  
  1499. *** End of Patch 9 ***
  1500. -- 
  1501. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1502. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1503. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1504. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1505.