home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume30 / perl / patch32 < prev    next >
Encoding:
Text File  |  1992-06-11  |  47.7 KB  |  1,845 lines

  1. Newsgroups: comp.sources.misc
  2. From: lwall@netlabs.com (Larry Wall)
  3. Subject:  v30i043:  perl - The perl programming language, Patch32
  4. Message-ID: <1992Jun11.180910.1586@sparky.imd.sterling.com>
  5. X-Md4-Signature: 900872f2ef4fa2bfde2abdf13c1965c7
  6. Date: Thu, 11 Jun 1992 18:09:10 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lwall@netlabs.com (Larry Wall)
  10. Posting-number: Volume 30, Issue 43
  11. Archive-name: perl/patch32
  12. Environment: UNIX, MS-DOS, OS2
  13. Patch-To: perl: Volume 18, Issue 19-54
  14.  
  15. System: perl version 4.0
  16. Patch #: 32
  17. Priority: highish
  18. Subject: patch #20, continued
  19.  
  20. Description:
  21.     See patch #20.
  22.  
  23. Fix:    From rn, say "| patch -p -N -d DIR", where DIR is your perl source
  24.     directory.  Outside of rn, say "cd DIR; patch -p -N <thisarticle".
  25.     If you don't have the patch program, apply the following by hand,
  26.     or get patch (version 2.0, latest patchlevel).
  27.  
  28.     After patching:
  29.         *** DO NOTHING--INSTALL ALL PATCHES UP THROUGH #33 FIRST ***
  30.  
  31.     If patch indicates that patchlevel is the wrong version, you may need
  32.     to apply one or more previous patches, or the patch may already
  33.     have been applied.  See the patchlevel.h file to find out what has or
  34.     has not been applied.  In any event, don't continue with the patch.
  35.  
  36.     If you are missing previous patches they can be obtained from me:
  37.  
  38.     Larry Wall
  39.     lwall@netlabs.com
  40.  
  41.     If you send a mail message of the following form it will greatly speed
  42.     processing:
  43.  
  44.     Subject: Command
  45.     @SH mailpatch PATH perl 4.0 LIST
  46.            ^ note the c
  47.  
  48.     where PATH is a return path FROM ME TO YOU either in Internet notation,
  49.     or in bang notation from some well-known host, and LIST is the number
  50.     of one or more patches you need, separated by spaces, commas, and/or
  51.     hyphens.  Saying 35- says everything from 35 to the end.
  52.  
  53.  
  54. Index: patchlevel.h
  55. Prereq: 31
  56. 1c1
  57. < #define PATCHLEVEL 31
  58. ---
  59. > #define PATCHLEVEL 32
  60.  
  61. Index: str.h
  62. *** str.h.old    Mon Jun  8 17:51:58 1992
  63. --- str.h    Mon Jun  8 17:51:59 1992
  64. ***************
  65. *** 1,4 ****
  66. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.3 $$Date: 91/11/05 18:41:47 $
  67.    *
  68.    *    Copyright (c) 1991, Larry Wall
  69.    *
  70. --- 1,4 ----
  71. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.4 $$Date: 92/06/08 15:41:45 $
  72.    *
  73.    *    Copyright (c) 1991, Larry Wall
  74.    *
  75. ***************
  76. *** 6,11 ****
  77. --- 6,15 ----
  78.    *    License or the Artistic License, as specified in the README file.
  79.    *
  80.    * $Log:    str.h,v $
  81. +  * Revision 4.0.1.4  92/06/08  15:41:45  lwall
  82. +  * patch20: fixed confusion between a *var's real name and its effective name
  83. +  * patch20: removed implicit int declarations on functions
  84. +  * 
  85.    * Revision 4.0.1.3  91/11/05  18:41:47  lwall
  86.    * patch11: random cleanup
  87.    * patch11: solitary subroutine references no longer trigger typo warnings
  88. ***************
  89. *** 26,37 ****
  90.       STRLEN    str_len;    /* allocated size */
  91.       union {
  92.       double    str_nval;    /* numeric value, if any */
  93. -     STAB    *str_stab;    /* magic stab for magic "key" string */
  94.       long    str_useful;    /* is this search optimization effective? */
  95.       ARG    *str_args;    /* list of args for interpreted string */
  96.       HASH    *str_hash;    /* string represents an assoc array (stab?) */
  97.       ARRAY    *str_array;    /* string represents an array */
  98.       CMD    *str_cmd;    /* command for this source line */
  99.       } str_u;
  100.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  101.       STR        *str_magic;    /* while free, link to next free str */
  102. --- 30,44 ----
  103.       STRLEN    str_len;    /* allocated size */
  104.       union {
  105.       double    str_nval;    /* numeric value, if any */
  106.       long    str_useful;    /* is this search optimization effective? */
  107.       ARG    *str_args;    /* list of args for interpreted string */
  108.       HASH    *str_hash;    /* string represents an assoc array (stab?) */
  109.       ARRAY    *str_array;    /* string represents an array */
  110.       CMD    *str_cmd;    /* command for this source line */
  111. +     struct {
  112. +         STAB *stb_stab;    /* magic stab for magic "key" string */
  113. +         HASH *stb_stash;    /* which symbol table this stab is in */
  114. +     } stb_u;
  115.       } str_u;
  116.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  117.       STR        *str_magic;    /* while free, link to next free str */
  118. ***************
  119. *** 51,62 ****
  120.       STRLEN    str_len;    /* allocated size */
  121.       union {
  122.       double    str_nval;    /* numeric value, if any */
  123. -     STAB    *str_stab;    /* magic stab for magic "key" string */
  124.       long    str_useful;    /* is this search optimization effective? */
  125.       ARG    *str_args;    /* list of args for interpreted string */
  126.       HASH    *str_hash;    /* string represents an assoc array (stab?) */
  127.       ARRAY    *str_array;    /* string represents an array */
  128.       CMD    *str_cmd;    /* command for this source line */
  129.       } str_u;
  130.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  131.       STR        *str_magic;    /* while free, link to next free str */
  132. --- 58,72 ----
  133.       STRLEN    str_len;    /* allocated size */
  134.       union {
  135.       double    str_nval;    /* numeric value, if any */
  136.       long    str_useful;    /* is this search optimization effective? */
  137.       ARG    *str_args;    /* list of args for interpreted string */
  138.       HASH    *str_hash;    /* string represents an assoc array (stab?) */
  139.       ARRAY    *str_array;    /* string represents an array */
  140.       CMD    *str_cmd;    /* command for this source line */
  141. +     struct {
  142. +         STAB *stb_stab;    /* magic stab for magic "key" string */
  143. +         HASH *stb_stash;    /* which symbol table this stab is in */
  144. +     } stb_u;
  145.       } str_u;
  146.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  147.       STR        *str_magic;    /* while free, link to next free str */
  148. ***************
  149. *** 71,76 ****
  150. --- 81,89 ----
  151.   #endif
  152.   };
  153.   
  154. + #define str_stab stb_u.stb_stab
  155. + #define str_stash stb_u.stb_stash
  156.   /* some extra info tacked to some lvalue strings */
  157.   
  158.   struct lstring {
  159. ***************
  160. *** 139,144 ****
  161. --- 152,168 ----
  162.   int str_eq();
  163.   void str_magic();
  164.   void str_insert();
  165. + void str_numset();
  166. + void str_sset();
  167. + void str_nset();
  168. + void str_set();
  169. + void str_chop();
  170. + void str_cat();
  171. + void str_scat();
  172. + void str_ncat();
  173. + void str_reset();
  174. + void str_taintproper();
  175. + void str_taintenv();
  176.   STRLEN str_len();
  177.   
  178.   #define MULTI    (3)
  179.  
  180. Index: lib/termcap.pl
  181. Prereq: 4.0
  182. *** lib/termcap.pl.old    Mon Jun  8 17:49:16 1992
  183. --- lib/termcap.pl    Mon Jun  8 17:49:17 1992
  184. ***************
  185. *** 1,4 ****
  186. ! ;# $Header: termcap.pl,v 4.0 91/03/20 01:26:33 lwall Locked $
  187.   ;#
  188.   ;# Usage:
  189.   ;#    require 'ioctl.pl';
  190. --- 1,4 ----
  191. ! ;# $RCSfile: termcap.pl,v $$Revision: 4.0.1.1 $$Date: 92/06/08 13:49:17 $
  192.   ;#
  193.   ;# Usage:
  194.   ;#    require 'ioctl.pl';
  195. ***************
  196. *** 21,27 ****
  197.       $TERMCAP = $ENV{'TERMCAP'};
  198.       $TERMCAP = '/etc/termcap' unless $TERMCAP;
  199.       if ($TERMCAP !~ m:^/:) {
  200. !     if (index($TERMCAP,"|$TERM|") < $[) {
  201.           $TERMCAP = '/etc/termcap';
  202.       }
  203.       }
  204. --- 21,27 ----
  205.       $TERMCAP = $ENV{'TERMCAP'};
  206.       $TERMCAP = '/etc/termcap' unless $TERMCAP;
  207.       if ($TERMCAP !~ m:^/:) {
  208. !     if ($TERMCAP !~ /(^|\|)$TERM[:\|]/) {
  209.           $TERMCAP = '/etc/termcap';
  210.       }
  211.       }
  212. ***************
  213. *** 33,39 ****
  214.           while (<TERMCAP>) {
  215.           next if /^#/;
  216.           next if /^\t/;
  217. !         if (/\\|$TERM[:\\|]/) {
  218.               chop;
  219.               while (chop eq '\\\\') {
  220.               \$_ .= <TERMCAP>;
  221. --- 33,39 ----
  222.           while (<TERMCAP>) {
  223.           next if /^#/;
  224.           next if /^\t/;
  225. !         if (/(^|\\|)$TERM[:\\|]/) {
  226.               chop;
  227.               while (chop eq '\\\\') {
  228.               \$_ .= <TERMCAP>;
  229.  
  230. Index: os2/tests.dif
  231. *** os2/tests.dif.old    Mon Jun  8 17:50:18 1992
  232. --- os2/tests.dif    Mon Jun  8 17:50:19 1992
  233. ***************
  234. *** 0 ****
  235. --- 1,589 ----
  236. + diff -cbBwr perl-4.019/t/base/term.t new/t/base/term.t
  237. + *** perl-4.019/t/base/term.t    Wed Mar 20 08:47:14 1991
  238. + --- new/t/base/term.t    Sun Jun 16 20:39:50 1991
  239. + ***************
  240. + *** 29,35 ****
  241. +   # check <> pseudoliteral
  242. + ! open(try, "/dev/null") || (die "Can't open /dev/null.");
  243. +   if (<try> eq '') {
  244. +       print "ok 5\n";
  245. +   }
  246. + --- 29,35 ----
  247. +   # check <> pseudoliteral
  248. + ! open(try, "nul") || (die "Can't open /dev/null.");
  249. +   if (<try> eq '') {
  250. +       print "ok 5\n";
  251. +   }
  252. + diff -cbBwr perl-4.019/t/cmd/while.t new/t/cmd/while.t
  253. + *** perl-4.019/t/cmd/while.t    Wed Mar 20 08:46:28 1991
  254. + --- new/t/cmd/while.t    Sun Jun 16 20:52:36 1991
  255. + ***************
  256. + *** 90,96 ****
  257. +   if (!eof || $bad) {print "not ok 8\n";} else {print "ok 8\n";}
  258. +   if (!$badcont) {print "ok 9\n";} else {print "not ok 9\n";}
  259. + ! `/bin/rm -f Cmd.while.tmp`;
  260. +   #$x = 0;
  261. +   #while (1) {
  262. + --- 90,97 ----
  263. +   if (!eof || $bad) {print "not ok 8\n";} else {print "ok 8\n";}
  264. +   if (!$badcont) {print "ok 9\n";} else {print "not ok 9\n";}
  265. + ! close(fh);
  266. + ! `del Cmd.while.tmp`;
  267. +   #$x = 0;
  268. +   #while (1) {
  269. + diff -cbBwr perl-4.019/t/comp/cpp.t new/t/comp/cpp.t
  270. + *** perl-4.019/t/comp/cpp.t    Wed Mar 20 08:48:44 1991
  271. + --- new/t/comp/cpp.t    Sun Jun 16 20:54:00 1991
  272. + ***************
  273. + *** 32,39 ****
  274. +   print TRY '#define OK "ok 3\n"' . "\n";
  275. +   close TRY;
  276. + ! $pwd=`pwd`;
  277. +   $pwd =~ s/\n//;
  278. + ! $x = `./perl -P Comp.cpp.tmp`;
  279. +   print $x;
  280. +   unlink "Comp.cpp.tmp", "Comp.cpp.inc";
  281. + --- 32,39 ----
  282. +   print TRY '#define OK "ok 3\n"' . "\n";
  283. +   close TRY;
  284. + ! $pwd=`cd`;
  285. +   $pwd =~ s/\n//;
  286. + ! $x = `perl -P Comp.cpp.tmp`;
  287. +   print $x;
  288. +   unlink "Comp.cpp.tmp", "Comp.cpp.inc";
  289. + diff -cbBwr perl-4.019/t/comp/script.t new/t/comp/script.t
  290. + *** perl-4.019/t/comp/script.t    Wed Mar 20 08:48:50 1991
  291. + --- new/t/comp/script.t    Sun Jun 16 21:05:02 1991
  292. + ***************
  293. + *** 4,10 ****
  294. +   print "1..3\n";
  295. + ! $x = `./perl -e 'print "ok\n";'`;
  296. +   if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";}
  297. + --- 4,10 ----
  298. +   print "1..3\n";
  299. + ! $x = `perl -e "print \\\"ok\\n\\\";"`;
  300. +   if ($x eq "ok\n") {print "ok 1\n";} else {print "not ok 1\n";}
  301. + ***************
  302. + *** 12,23 ****
  303. +   print try 'print "ok\n";'; print try "\n";
  304. +   close try;
  305. + ! $x = `./perl Comp.script`;
  306. +   if ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";}
  307. + ! $x = `./perl <Comp.script`;
  308. +   if ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";}
  309. + ! `/bin/rm -f Comp.script`;
  310. + --- 12,23 ----
  311. +   print try 'print "ok\n";'; print try "\n";
  312. +   close try;
  313. + ! $x = `perl Comp.script`;
  314. +   if ($x eq "ok\n") {print "ok 2\n";} else {print "not ok 2\n";}
  315. + ! $x = `perl <Comp.script`;
  316. +   if ($x eq "ok\n") {print "ok 3\n";} else {print "not ok 3\n";}
  317. + ! `del Comp.script`;
  318. + diff -cbBwr perl-4.019/t/io/argv.t new/t/io/argv.t
  319. + *** perl-4.019/t/io/argv.t    Wed Mar 20 08:48:38 1991
  320. + --- new/t/io/argv.t    Sun Jun 16 21:14:14 1991
  321. + ***************
  322. + *** 8,26 ****
  323. +   print try "a line\n";
  324. +   close try;
  325. + ! $x = `./perl -e 'while (<>) {print \$.,\$_;}' Io.argv.tmp Io.argv.tmp`;
  326. +   if ($x eq "1a line\n2a line\n") {print "ok 1\n";} else {print "not ok 1\n";}
  327. + ! $x = `echo foo|./perl -e 'while (<>) {print $_;}' Io.argv.tmp -`;
  328. +   if ($x eq "a line\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
  329. + ! $x = `echo foo|./perl -e 'while (<>) {print $_;}'`;
  330. +   if ($x eq "foo\n") {print "ok 3\n";} else {print "not ok 3 :$x:\n";}
  331. + ! @ARGV = ('Io.argv.tmp', 'Io.argv.tmp', '/dev/null', 'Io.argv.tmp');
  332. +   while (<>) {
  333. +       $y .= $. . $_;
  334. +       if (eof()) {
  335. + --- 8,26 ----
  336. +   print try "a line\n";
  337. +   close try;
  338. + ! $x = `perl -e "while (<>) {print \$.,\$_;}" Io.argv.tmp Io.argv.tmp`;
  339. +   if ($x eq "1a line\n2a line\n") {print "ok 1\n";} else {print "not ok 1\n";}
  340. + ! $x = `echo foo | perl -e "while (<>) {print $_;}" Io.argv.tmp -`;
  341. +   if ($x eq "a line\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
  342. + ! $x = `echo foo | perl -e "while (<>) {print $_;}"`;
  343. +   if ($x eq "foo\n") {print "ok 3\n";} else {print "not ok 3 :$x:\n";}
  344. + ! @ARGV = ('Io.argv.tmp', 'Io.argv.tmp', 'nul', 'Io.argv.tmp');
  345. +   while (<>) {
  346. +       $y .= $. . $_;
  347. +       if (eof()) {
  348. + ***************
  349. + *** 33,36 ****
  350. +   else
  351. +       {print "not ok 5\n";}
  352. + ! `/bin/rm -f Io.argv.tmp`;
  353. + --- 33,36 ----
  354. +   else
  355. +       {print "not ok 5\n";}
  356. + ! `del Io.argv.tmp`;
  357. + diff -cbBwr perl-4.019/t/io/pipe.t new/t/io/pipe.t
  358. + *** perl-4.019/t/io/pipe.t    Wed Mar 20 08:48:38 1991
  359. + --- new/t/io/pipe.t    Sun Jun 16 21:25:14 1991
  360. + ***************
  361. + *** 5,11 ****
  362. +   $| = 1;
  363. +   print "1..8\n";
  364. + ! open(PIPE, "|-") || (exec 'tr', '[A-Z]', '[a-z]');
  365. +   print PIPE "OK 1\n";
  366. +   print PIPE "ok 2\n";
  367. +   close PIPE;
  368. + --- 5,11 ----
  369. +   $| = 1;
  370. +   print "1..8\n";
  371. + ! open(PIPE, "|-") || (exec 'tr.exe', '[A-Z]', '[a-z]');
  372. +   print PIPE "OK 1\n";
  373. +   print PIPE "ok 2\n";
  374. +   close PIPE;
  375. + ***************
  376. + *** 18,24 ****
  377. +   }
  378. +   else {
  379. +       print STDOUT "not ok 3\n";
  380. + !     exec 'echo', 'not ok 4';
  381. +   }
  382. +   pipe(READER,WRITER) || die "Can't open pipe";
  383. + --- 18,24 ----
  384. +   }
  385. +   else {
  386. +       print STDOUT "not ok 3\n";
  387. + !     exec 'perlglob', 'not ok 4';
  388. +   }
  389. +   pipe(READER,WRITER) || die "Can't open pipe";
  390. + diff -cbBwr perl-4.019/t/op/exec.t new/t/op/exec.t
  391. + *** perl-4.019/t/op/exec.t    Wed Mar 20 08:48:46 1991
  392. + --- new/t/op/exec.t    Sun Jun 16 21:39:32 1991
  393. + ***************
  394. + *** 7,21 ****
  395. +   print "not ok 1\n" if system "echo ok \\1";    # shell interpreted
  396. +   print "not ok 2\n" if system "echo ok 2";    # split and directly called
  397. + ! print "not ok 3\n" if system "echo", "ok", "3"; # directly called
  398. + ! if (system "true") {print "not ok 4\n";} else {print "ok 4\n";}
  399. + ! if ((system "/bin/sh -c 'exit 1'") != 256) { print "not "; }
  400. +   print "ok 5\n";
  401. + ! if ((system "lskdfj") == 255 << 8) {print "ok 6\n";} else {print "not ok 6\n";}
  402. +   unless (exec "lskdjfalksdjfdjfkls") {print "ok 7\n";} else {print "not ok 7\n";}
  403. + ! exec "echo","ok","8";
  404. + --- 7,21 ----
  405. +   print "not ok 1\n" if system "echo ok \\1";    # shell interpreted
  406. +   print "not ok 2\n" if system "echo ok 2";    # split and directly called
  407. + ! print "not ok 3\n" if system "perlglob", "ok", "3", "\n"; # directly called
  408. + ! if (system "expr 1 >nul") {print "not ok 4\n";} else {print "ok 4\n";}
  409. + ! if ((system "sh -c \"exit 1\"") != 1) { print "not "; }
  410. +   print "ok 5\n";
  411. + ! if ((system "lskdfj") == 1) {print "ok 6\n";} else {print "not ok 6\n";}
  412. +   unless (exec "lskdjfalksdjfdjfkls") {print "ok 7\n";} else {print "not ok 7\n";}
  413. + ! exec "perlglob","ok","8";
  414. + diff -cbBwr perl-4.019/t/op/glob.t new/t/op/glob.t
  415. + *** perl-4.019/t/op/glob.t    Wed Mar 20 08:48:54 1991
  416. + --- new/t/op/glob.t    Sun Jun 16 21:43:26 1991
  417. + ***************
  418. + *** 7,13 ****
  419. +   @ops = <op/*>;
  420. +   $list = join(' ',@ops);
  421. + ! chop($otherway = `echo op/*`);
  422. +   print $list eq $otherway ? "ok 1\n" : "not ok 1\n$list\n$otherway\n";
  423. + --- 7,13 ----
  424. +   @ops = <op/*>;
  425. +   $list = join(' ',@ops);
  426. + ! chop($otherway = `perlglob op/*`);
  427. +   print $list eq $otherway ? "ok 1\n" : "not ok 1\n$list\n$otherway\n";
  428. + diff -cbBwr perl-4.019/t/op/goto.t new/t/op/goto.t
  429. + *** perl-4.019/t/op/goto.t    Wed Mar 20 08:48:46 1991
  430. + --- new/t/op/goto.t    Sun Jun 16 21:50:54 1991
  431. + ***************
  432. + *** 29,34 ****
  433. +   print "#2\t:$foo: == 4\n";
  434. +   if ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";}
  435. + ! $x = `./perl -e 'goto foo;' 2>&1`;
  436. +   print "#3\t/label/ in :$x";
  437. +   if ($x =~ /label/) {print "ok 3\n";} else {print "not ok 3\n";}
  438. + --- 29,34 ----
  439. +   print "#2\t:$foo: == 4\n";
  440. +   if ($foo == 4) {print "ok 2\n";} else {print "not ok 2\n";}
  441. + ! $x = `perl -e "goto foo;" 2>&1`;
  442. +   print "#3\t/label/ in :$x";
  443. +   if ($x =~ /label/) {print "ok 3\n";} else {print "not ok 3\n";}
  444. + diff -cbBwr perl-4.019/t/op/magic.t new/t/op/magic.t
  445. + *** perl-4.019/t/op/magic.t    Wed Mar 20 08:48:36 1991
  446. + --- new/t/op/magic.t    Sun Jun 16 21:56:14 1991
  447. + ***************
  448. + *** 7,13 ****
  449. +   print "1..5\n";
  450. +   eval '$ENV{"foo"} = "hi there";';    # check that ENV is inited inside eval
  451. + ! if (`echo \$foo` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}
  452. +   unlink 'ajslkdfpqjsjfk';
  453. +   $! = 0;
  454. + --- 7,13 ----
  455. +   print "1..5\n";
  456. +   eval '$ENV{"foo"} = "hi there";';    # check that ENV is inited inside eval
  457. + ! if (`echo %foo%` eq "hi there\n") {print "ok 1\n";} else {print "not ok 1\n";}
  458. +   unlink 'ajslkdfpqjsjfk';
  459. +   $! = 0;
  460. + ***************
  461. + *** 17,30 ****
  462. +   # the next tests are embedded inside system simply because sh spits out
  463. +   # a newline onto stderr when a child process kills itself with SIGINT.
  464. + ! system './perl',
  465. +   '-e', '$| = 1;        # command buffering',
  466. + ! '-e', '$SIG{"INT"} = "ok3"; kill 2,$$;',
  467. + ! '-e', '$SIG{"INT"} = "IGNORE"; kill 2,$$; print "ok 4\n";',
  468. + ! '-e', '$SIG{"INT"} = "DEFAULT"; kill 2,$$; print "not ok\n";',
  469. + ! '-e', 'sub ok3 { print "ok 3\n" if pop(@_) eq "INT"; }';
  470. +   @val1 = @ENV{keys(%ENV)};    # can we slice ENV?
  471. +   @val2 = values(%ENV);
  472. + --- 17,30 ----
  473. +   # the next tests are embedded inside system simply because sh spits out
  474. +   # a newline onto stderr when a child process kills itself with SIGINT.
  475. + ! system 'perl',
  476. +   '-e', '$| = 1;        # command buffering',
  477. + ! '-e', '$SIG{"TERM"} = "ok3"; kill 0,$$;',
  478. + ! '-e', '$SIG{"TERM"} = "IGNORE"; kill 0,$$; print "ok 4\n";',
  479. + ! '-e', '$SIG{"TERM"} = "DEFAULT"; kill 0,$$; print "not ok\n";',
  480. + ! '-e', 'sub ok3 { print "ok 3\n" if pop(@_) eq "TERM"; }';
  481. +   @val1 = @ENV{keys(%ENV)};    # can we slice ENV?
  482. +   @val2 = values(%ENV);
  483. + diff -cbBwr perl-4.019/t/op/mkdir.t new/t/op/mkdir.t
  484. + *** perl-4.019/t/op/mkdir.t    Wed Mar 20 08:48:54 1991
  485. + --- new/t/op/mkdir.t    Sun Jun 16 22:00:06 1991
  486. + ***************
  487. + *** 4,14 ****
  488. +   print "1..7\n";
  489. + ! `rm -rf blurfl`;
  490. +   print (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n");
  491. +   print (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n");
  492. + ! print ($! =~ /exist/ ? "ok 3\n" : "not ok 3\n");
  493. +   print (-d 'blurfl' ? "ok 4\n" : "not ok 4\n");
  494. +   print (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n");
  495. +   print (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n");
  496. + --- 4,14 ----
  497. +   print "1..7\n";
  498. + ! `rm -r blurfl`;
  499. +   print (mkdir('blurfl',0777) ? "ok 1\n" : "not ok 1\n");
  500. +   print (mkdir('blurfl',0777) ? "not ok 2\n" : "ok 2\n");
  501. + ! print ($! =~ /denied/ ? "ok 3\n" : "not ok 3\n");
  502. +   print (-d 'blurfl' ? "ok 4\n" : "not ok 4\n");
  503. +   print (rmdir('blurfl') ? "ok 5\n" : "not ok 5\n");
  504. +   print (rmdir('blurfl') ? "not ok 6\n" : "ok 6\n");
  505. + diff -cbBwr perl-4.019/t/op/split.t new/t/op/split.t
  506. + *** perl-4.019/t/op/split.t    Wed Mar 20 08:48:24 1991
  507. + --- new/t/op/split.t    Sun Jun 16 22:04:02 1991
  508. + ***************
  509. + *** 47,53 ****
  510. +   print $_ eq '1:2:3:4:5:6:::' ? "ok 10\n" : "not ok 10 $_\n";
  511. +   # Does assignment to a list imply split to one more field than that?
  512. + ! $foo = `./perl -D1024 -e '(\$a,\$b) = split;' 2>&1`;
  513. +   print $foo =~ /DEBUGGING/ || $foo =~ /num\(3\)/ ? "ok 11\n" : "not ok 11\n";
  514. +   # Can we say how many fields to split to when assigning to a list?
  515. + --- 47,53 ----
  516. +   print $_ eq '1:2:3:4:5:6:::' ? "ok 10\n" : "not ok 10 $_\n";
  517. +   # Does assignment to a list imply split to one more field than that?
  518. + ! $foo = `perl -D1024 -e "(\$a,\$b) = split;" 2>&1`;
  519. +   print $foo =~ /DEBUGGING/ || $foo =~ /num\(3\)/ ? "ok 11\n" : "not ok 11\n";
  520. +   # Can we say how many fields to split to when assigning to a list?
  521. + diff -cbBwr perl-4.019/t/op/stat.t new/t/op/stat.t
  522. + *** perl-4.019/t/op/stat.t    Fri Nov 22 22:04:46 1991
  523. + --- new/t/op/stat.t    Fri Nov 22 22:16:40 1991
  524. + ***************
  525. + *** 4,12 ****
  526. +   print "1..56\n";
  527. + ! chop($cwd = `pwd`);
  528. + ! $DEV = `ls -l /dev`;
  529. +   unlink "Op.stat.tmp";
  530. +   open(FOO, ">Op.stat.tmp");
  531. + --- 4,12 ----
  532. +   print "1..56\n";
  533. + ! chop($cwd = `cd`);
  534. + ! $DEV = `ls -l`;
  535. +   unlink "Op.stat.tmp";
  536. +   open(FOO, ">Op.stat.tmp");
  537. + ***************
  538. + *** 23,29 ****
  539. +   sleep 2;
  540. + ! `rm -f Op.stat.tmp2; ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp`;
  541. +   ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  542. +       $blksize,$blocks) = stat('Op.stat.tmp');
  543. + --- 23,29 ----
  544. +   sleep 2;
  545. + ! `del Op.stat.tmp2; ln Op.stat.tmp Op.stat.tmp2; chmod 644 Op.stat.tmp 2>nul`;
  546. +   ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  547. +       $blksize,$blocks) = stat('Op.stat.tmp');
  548. + ***************
  549. + *** 73,80 ****
  550. +   if (-d '.') {print "ok 23\n";} else {print "not ok 23\n";}
  551. +   if (! -f '.') {print "ok 24\n";} else {print "not ok 24\n";}
  552. + ! if (`ls -l perl` =~ /^l.*->/) {
  553. + !     if (-l 'perl') {print "ok 25\n";} else {print "not ok 25\n";}
  554. +   }
  555. +   else {
  556. +       print "ok 25\n";
  557. + --- 73,80 ----
  558. +   if (-d '.') {print "ok 23\n";} else {print "not ok 23\n";}
  559. +   if (! -f '.') {print "ok 24\n";} else {print "not ok 24\n";}
  560. + ! if (`ls -l perl.exe` =~ /^l.*->/) {
  561. + !     if (-l 'perl.exe') {print "ok 25\n";} else {print "not ok 25\n";}
  562. +   }
  563. +   else {
  564. +       print "ok 25\n";
  565. + ***************
  566. + *** 83,89 ****
  567. +   if (-o 'Op.stat.tmp') {print "ok 26\n";} else {print "not ok 26\n";}
  568. +   if (-e 'Op.stat.tmp') {print "ok 27\n";} else {print "not ok 27\n";}
  569. + ! `rm -f Op.stat.tmp Op.stat.tmp2`;
  570. +   if (! -e 'Op.stat.tmp') {print "ok 28\n";} else {print "not ok 28\n";}
  571. +   if ($DEV !~ /\nc.* (\S+)\n/)
  572. + --- 83,89 ----
  573. +   if (-o 'Op.stat.tmp') {print "ok 26\n";} else {print "not ok 26\n";}
  574. +   if (-e 'Op.stat.tmp') {print "ok 27\n";} else {print "not ok 27\n";}
  575. + ! `del Op.stat.tmp Op.stat.tmp2 2>nul`;
  576. +   if (! -e 'Op.stat.tmp') {print "ok 28\n";} else {print "not ok 28\n";}
  577. +   if ($DEV !~ /\nc.* (\S+)\n/)
  578. + ***************
  579. + *** 113,119 ****
  580. +   $cnt = $uid = 0;
  581. +   die "Can't run op/stat.t test 35 without pwd working" unless $cwd;
  582. + ! chdir '/usr/bin' || die "Can't cd to /usr/bin";
  583. +   while (defined($_ = <*>)) {
  584. +       $cnt++;
  585. +       $uid++ if -u;
  586. + --- 113,119 ----
  587. +   $cnt = $uid = 0;
  588. +   die "Can't run op/stat.t test 35 without pwd working" unless $cwd;
  589. + ! chdir '../os2' || die "Can't cd to ../os2";
  590. +   while (defined($_ = <*>)) {
  591. +       $cnt++;
  592. +       $uid++ if -u;
  593. + ***************
  594. + *** 124,138 ****
  595. +   # I suppose this is going to fail somewhere...
  596. +   if ($uid > 0 && $uid < $cnt) {print "ok 35\n";} else {print "not ok 35\n";}
  597. + ! unless (open(tty,"/dev/tty")) {
  598. + !     print STDERR "Can't open /dev/tty--run t/TEST outside of make.\n";
  599. +   }
  600. +   if (-t tty) {print "ok 36\n";} else {print "not ok 36\n";}
  601. +   if (-c tty) {print "ok 37\n";} else {print "not ok 37\n";}
  602. +   close(tty);
  603. +   if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";}
  604. + ! open(null,"/dev/null");
  605. + ! if (! -t null || -e '/xenix') {print "ok 39\n";} else {print "not ok 39\n";}
  606. +   close(null);
  607. +   if (-t) {print "ok 40\n";} else {print "not ok 40\n";}
  608. + --- 124,138 ----
  609. +   # I suppose this is going to fail somewhere...
  610. +   if ($uid > 0 && $uid < $cnt) {print "ok 35\n";} else {print "not ok 35\n";}
  611. + ! unless (open(tty,"con")) {
  612. + !     print STDERR "Can't open con--run t/TEST outside of make.\n";
  613. +   }
  614. +   if (-t tty) {print "ok 36\n";} else {print "not ok 36\n";}
  615. +   if (-c tty) {print "ok 37\n";} else {print "not ok 37\n";}
  616. +   close(tty);
  617. +   if (! -t tty) {print "ok 38\n";} else {print "not ok 38\n";}
  618. + ! open(null,"nul");
  619. + ! if (! -t null || -e 'c:/os2krnl') {print "ok 39\n";} else {print "not ok 39\n";}
  620. +   close(null);
  621. +   if (-t) {print "ok 40\n";} else {print "not ok 40\n";}
  622. + ***************
  623. + *** 141,148 ****
  624. +   if (-T 'op/stat.t') {print "ok 41\n";} else {print "not ok 41\n";}
  625. +   if (! -B 'op/stat.t') {print "ok 42\n";} else {print "not ok 42\n";}
  626. + ! if (-B './perl') {print "ok 43\n";} else {print "not ok 43\n";}
  627. + ! if (! -T './perl') {print "ok 44\n";} else {print "not ok 44\n";}
  628. +   open(FOO,'op/stat.t');
  629. +   eval { -T FOO; };
  630. + --- 141,148 ----
  631. +   if (-T 'op/stat.t') {print "ok 41\n";} else {print "not ok 41\n";}
  632. +   if (! -B 'op/stat.t') {print "ok 42\n";} else {print "not ok 42\n";}
  633. + ! if (-B 'perl.exe') {print "ok 43\n";} else {print "not ok 43\n";}
  634. + ! if (! -T 'perl.exe') {print "ok 44\n";} else {print "not ok 44\n";}
  635. +   open(FOO,'op/stat.t');
  636. +   eval { -T FOO; };
  637. + ***************
  638. + *** 172,176 ****
  639. +   }
  640. +   close(FOO);
  641. + ! if (-T '/dev/null') {print "ok 55\n";} else {print "not ok 55\n";}
  642. + ! if (-B '/dev/null') {print "ok 56\n";} else {print "not ok 56\n";}
  643. + --- 172,176 ----
  644. +   }
  645. +   close(FOO);
  646. + ! if (-T 'nul') {print "ok 55\n";} else {print "not ok 55\n";}
  647. + ! if (-B 'nul') {print "ok 56\n";} else {print "not ok 56\n";}
  648. + diff -cbBwr perl-4.019/t/TEST new/t/TEST
  649. + *** perl-4.019/t/TEST    Tue Jun 11 23:32:06 1991
  650. + --- new/t/TEST    Sun Jun 16 20:47:38 1991
  651. + ***************
  652. + *** 16,22 ****
  653. +   if ($ARGV[0] eq '') {
  654. +       @ARGV = split(/[ \n]/,
  655. + !       `echo base/*.t comp/*.t cmd/*.t io/*.t; echo op/*.t lib/*.t`);
  656. +   }
  657. +   open(CONFIG,"../config.sh");
  658. + --- 16,22 ----
  659. +   if ($ARGV[0] eq '') {
  660. +       @ARGV = split(/[ \n]/,
  661. + !       `ls base/*.t comp/*.t cmd/*.t io/*.t op/*.t lib/*.t`);
  662. +   }
  663. +   open(CONFIG,"../config.sh");
  664. + ***************
  665. + *** 35,41 ****
  666. +       chop($te);
  667. +       print "$te" . '.' x (15 - length($te));
  668. +       if ($sharpbang) {
  669. + !     open(results,"./$test|") || (print "can't run.\n");
  670. +       } else {
  671. +       open(script,"$test") || die "Can't run $test.\n";
  672. +       $_ = <script>;
  673. + --- 35,41 ----
  674. +       chop($te);
  675. +       print "$te" . '.' x (15 - length($te));
  676. +       if ($sharpbang) {
  677. + !     open(results,"$test|") || (print "can't run.\n");
  678. +       } else {
  679. +       open(script,"$test") || die "Can't run $test.\n";
  680. +       $_ = <script>;
  681. + ***************
  682. + *** 45,51 ****
  683. +       } else {
  684. +           $switch = '';
  685. +       }
  686. + !     open(results,"./perl$switch $test|") || (print "can't run.\n");
  687. +       }
  688. +       $ok = 0;
  689. +       $next = 0;
  690. + --- 45,51 ----
  691. +       } else {
  692. +           $switch = '';
  693. +       }
  694. + !     open(results,"perl$switch $test|") || (print "can't run.\n");
  695. +       }
  696. +       $ok = 0;
  697. +       $next = 0;
  698.  
  699. Index: lib/timelocal.pl
  700. *** lib/timelocal.pl.old    Mon Jun  8 17:49:19 1992
  701. --- lib/timelocal.pl    Mon Jun  8 17:49:19 1992
  702. ***************
  703. *** 1,7 ****
  704.   ;# timelocal.pl
  705.   ;#
  706.   ;# Usage:
  707. ! ;#    $time = timelocal($sec,$min,$hours,$mday,$mon,$year,$junk,$junk,$isdst);
  708.   ;#    $time = timegm($sec,$min,$hours,$mday,$mon,$year);
  709.   
  710.   ;# These routines are quite efficient and yet are always guaranteed to agree
  711. --- 1,7 ----
  712.   ;# timelocal.pl
  713.   ;#
  714.   ;# Usage:
  715. ! ;#    $time = timelocal($sec,$min,$hours,$mday,$mon,$year);
  716.   ;#    $time = timegm($sec,$min,$hours,$mday,$mon,$year);
  717.   
  718.   ;# These routines are quite efficient and yet are always guaranteed to agree
  719. ***************
  720. *** 24,29 ****
  721. --- 24,30 ----
  722.   CONFIG: {
  723.       package timelocal;
  724.       
  725. +     local($[) = 0;
  726.       @epoch = localtime(0);
  727.       $tzmin = $epoch[2] * 60 + $epoch[1];    # minutes east of GMT
  728.       if ($tzmin > 0) {
  729. ***************
  730. *** 40,45 ****
  731. --- 41,47 ----
  732.   sub timegm {
  733.       package timelocal;
  734.   
  735. +     local($[) = 0;
  736.       $ym = pack(C2, @_[5,4]);
  737.       $cheat = $cheat{$ym} || &cheat;
  738.       $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS;
  739. ***************
  740. *** 48,57 ****
  741.   sub timelocal {
  742.       package timelocal;
  743.   
  744. !     $ym = pack(C2, @_[5,4]);
  745. !     $cheat = $cheat{$ym} || &cheat;
  746. !     $cheat + $_[0] * $SEC + $_[1] * $MIN + $_[2] * $HR + ($_[3]-1) * $DAYS
  747. !     + $tzmin * $MIN - 60 * 60 * ($_[8] != 0);
  748.   }
  749.   
  750.   package timelocal;
  751. --- 50,60 ----
  752.   sub timelocal {
  753.       package timelocal;
  754.   
  755. !     local($[) = 0;
  756. !     $time = &main'timegm + $tzmin*$MIN;
  757. !     @test = localtime($time);
  758. !     $time -= $HR if $test[2] != $_[2];
  759. !     $time;
  760.   }
  761.   
  762.   package timelocal;
  763. ***************
  764. *** 59,72 ****
  765.   sub cheat {
  766.       $year = $_[5];
  767.       $month = $_[4];
  768.       $guess = $^T;
  769.       @g = gmtime($guess);
  770.       while ($diff = $year - $g[5]) {
  771. !     $guess += $diff * (364 * $DAYS);
  772.       @g = gmtime($guess);
  773.       }
  774.       while ($diff = $month - $g[4]) {
  775. !     $guess += $diff * (28 * $DAYS);
  776.       @g = gmtime($guess);
  777.       }
  778.       $g[3]--;
  779. --- 62,76 ----
  780.   sub cheat {
  781.       $year = $_[5];
  782.       $month = $_[4];
  783. +     die "Month out of range 0..11 in ctime.pl\n" if $month > 11;
  784.       $guess = $^T;
  785.       @g = gmtime($guess);
  786.       while ($diff = $year - $g[5]) {
  787. !     $guess += $diff * (363 * $DAYS);
  788.       @g = gmtime($guess);
  789.       }
  790.       while ($diff = $month - $g[4]) {
  791. !     $guess += $diff * (27 * $DAYS);
  792.       @g = gmtime($guess);
  793.       }
  794.       $g[3]--;
  795.  
  796. Index: hints/titan.sh
  797. *** hints/titan.sh.old    Mon Jun  8 17:48:23 1992
  798. --- hints/titan.sh    Mon Jun  8 17:48:23 1992
  799. ***************
  800. *** 0 ****
  801. --- 1,40 ----
  802. + # Hints file (perl 4.019) for Kubota Pacific's Titan 3000 Series Machines.
  803. + # Created by: JT McDuffie (jt@kpc.com)  26 DEC 1991
  804. + bin='/usr/local/bin'
  805. + installbin='/usr/local/bin'
  806. + alignbytes="8"
  807. + byteorder="4321"
  808. + cppstdin='/lib/cpp'
  809. + cppminus=''
  810. + castflags='0'
  811. + gid_type='ushort'
  812. + groupstype='unsigned short'
  813. + intsize='4'
  814. + libc='/lib/libc.a'
  815. + nm_opts='-eh'
  816. + mallocptrtype='void'
  817. + mansrc='/usr/man/man1'
  818. + installmansrc='/usr/man/man1'
  819. + manext='1'
  820. + models='none'
  821. + optimize='-O'
  822. + ccflags="$ccflags -I/usr/include/net -DDEBUGGING"
  823. + cppflags="$cppflags -I/usr/include/net -DDEBUGGING"
  824. + cc='cc'
  825. + libs='-lnsl -ldbm -lPW -lmalloc -lm'
  826. + libswanted='net socket nsl nm ndir ndbm dbm PW malloc m x posix '
  827. + scriptdir='/usr/local/bin'
  828. + installscr='/usr/local/bin'
  829. + stdchar='unsigned char'
  830. + uidtype='ushort'
  831. + usrinclude='/usr/include'
  832. + voidhave='7'
  833. + w_localtim='1'
  834. + w_s_timevl='1'
  835. + w_s_tm='1'
  836. + privlib='/usr/local/lib/perl'
  837. + installprivlib='/usr/local/lib/perl'
  838. + inclwanted='/usr/include /usr/include/net '
  839. + libpth=' /usr/lib /usr/local/lib /lib'
  840. + eoPATH='/bin /usr/bin /usr/ucb /usr/local /usr/local/bin /usr/lbin /etc /usr/lib /lib /usr/local/lib '
  841. + pth=' . /bin /usr/bin /usr/ucb /usr/local/bin /usr/X11/bin /usr/lbin /etc /usr/lib /lib /usr/local/lib '
  842.  
  843. Index: atarist/usub/usersub.c
  844. *** atarist/usub/usersub.c.old    Mon Jun  8 17:45:37 1992
  845. --- atarist/usub/usersub.c    Mon Jun  8 17:45:37 1992
  846. ***************
  847. *** 0 ****
  848. --- 1,27 ----
  849. + /* $RCSfile: usersub.c,v $$Revision: 4.0.1.1 $$Date: 92/06/08 11:54:52 $
  850. +  *
  851. +  * $Log:    usersub.c,v $
  852. +  * Revision 4.0.1.1  92/06/08  11:54:52  lwall
  853. +  * Initial revision
  854. +  * 
  855. +  * Revision 4.0.1.1  91/11/05  19:07:24  lwall
  856. +  * patch11: there are now subroutines for calling back from C into Perl
  857. +  * 
  858. +  * Revision 4.0  91/03/20  01:56:34  lwall
  859. +  * 4.0 baseline.
  860. +  * 
  861. +  * Revision 3.0.1.1  90/08/09  04:06:10  lwall
  862. +  * patch19: Initial revision
  863. +  * 
  864. +  */
  865. + #include "EXTERN.h"
  866. + #include "perl.h"
  867. + int
  868. + userinit()
  869. + {
  870. +     install_null();    /* install device /dev/null or NUL: */
  871. +     init_curses();
  872. +     return 0;
  873. + }
  874.  
  875. Index: usersub.c
  876. *** usersub.c.old    Mon Jun  8 17:52:23 1992
  877. --- usersub.c    Mon Jun  8 17:52:23 1992
  878. ***************
  879. *** 1,4 ****
  880. ! /* $RCSfile: usersub.c,v $$Revision: 4.0.1.1 $$Date: 91/11/11 16:47:17 $
  881.    *
  882.    *  This file contains stubs for routines that the user may define to
  883.    *  set up glue routines for C libraries or to decrypt encrypted scripts
  884. --- 1,4 ----
  885. ! /* $RCSfile: usersub.c,v $$Revision: 4.0.1.2 $$Date: 92/06/08 16:04:24 $
  886.    *
  887.    *  This file contains stubs for routines that the user may define to
  888.    *  set up glue routines for C libraries or to decrypt encrypted scripts
  889. ***************
  890. *** 5,10 ****
  891. --- 5,13 ----
  892.    *  for execution.
  893.    *
  894.    * $Log:    usersub.c,v $
  895. +  * Revision 4.0.1.2  92/06/08  16:04:24  lwall
  896. +  * patch20: removed implicit int declarations on functions
  897. +  * 
  898.    * Revision 4.0.1.1  91/11/11  16:47:17  lwall
  899.    * patch19: deleted some unused functions from usersub.c
  900.    * 
  901. ***************
  902. *** 16,21 ****
  903. --- 19,25 ----
  904.   #include "EXTERN.h"
  905.   #include "perl.h"
  906.   
  907. + int
  908.   userinit()
  909.   {
  910.       return 0;
  911. ***************
  912. *** 46,51 ****
  913. --- 50,56 ----
  914.   #define    CRYPT_MAGIC_1    0xfb
  915.   #define    CRYPT_MAGIC_2    0xf1
  916.   
  917. + void
  918.   cryptfilter( fil )
  919.   FILE *    fil;
  920.   {
  921. ***************
  922. *** 113,118 ****
  923. --- 118,124 ----
  924.       return fdopen(p[0], "r");
  925.   }
  926.   
  927. + void
  928.   cryptswitch()
  929.   {
  930.       int ch;
  931.  
  932. Index: hints/utekv.sh
  933. *** hints/utekv.sh.old    Mon Jun  8 17:48:31 1992
  934. --- hints/utekv.sh    Mon Jun  8 17:48:31 1992
  935. ***************
  936. *** 0 ****
  937. --- 1,18 ----
  938. + # XD88/10 UTekV hints by Kaveh Ghazi (ghazi@caip.rutgers.edu)  2/11/92
  939. + # The -DUTekV is needed because the greenhills compiler does not have any
  940. + # UTekV specific definitions and we need one in perl.h
  941. + ccflags="$ccflags -X18 -DJMPCLOBBER -DUTekV"
  942. + usemymalloc='y'
  943. + # /usr/include/rpcsvc is for finding dbm.h
  944. + inclwanted="$inclwanted /usr/include/rpcsvc"
  945. + # dont use the wrapper, use the real thing.
  946. + cppstdin=/lib/cpp
  947. + echo " "
  948. + echo "NOTE: You may have to take out makefile dependencies on the files in"
  949. + echo "/usr/include (i.e. /usr/include/ctype.h) or the make will fail.  A"
  950. + echo "simple 'grep -v /usr/include/ makefile' should suffice."
  951.  
  952. Index: util.c
  953. *** util.c.old    Mon Jun  8 17:52:33 1992
  954. --- util.c    Mon Jun  8 17:52:34 1992
  955. ***************
  956. *** 1,4 ****
  957. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.4 $$Date: 91/11/11 16:48:54 $
  958.    *
  959.    *    Copyright (c) 1991, Larry Wall
  960.    *
  961. --- 1,4 ----
  962. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.5 $$Date: 92/06/08 16:08:37 $
  963.    *
  964.    *    Copyright (c) 1991, Larry Wall
  965.    *
  966. ***************
  967. *** 6,11 ****
  968. --- 6,18 ----
  969.    *    License or the Artistic License, as specified in the README file.
  970.    *
  971.    * $Log:    util.c,v $
  972. +  * Revision 4.0.1.5  92/06/08  16:08:37  lwall
  973. +  * patch20: removed implicit int declarations on functions
  974. +  * patch20: Perl now distinguishes overlapped copies from non-overlapped
  975. +  * patch20: fixed confusion between a *var's real name and its effective name
  976. +  * patch20: bcopy() and memcpy() now tested for overlap safety
  977. +  * patch20: added Atari ST portability
  978. +  * 
  979.    * Revision 4.0.1.4  91/11/11  16:48:54  lwall
  980.    * patch19: study was busted by 4.018
  981.    * patch19: added little-endian pack/unpack options
  982. ***************
  983. *** 96,111 ****
  984.   #endif
  985.       ptr = malloc(size?size:1);    /* malloc(0) is NASTY on our system */
  986.   #ifdef DEBUGGING
  987. ! #  ifndef I286
  988.       if (debug & 128)
  989. !     fprintf(stderr,"0x%x: (%05d) malloc %d bytes\n",ptr,an++,size);
  990.   #  else
  991.       if (debug & 128)
  992. !     fprintf(stderr,"0x%lx: (%05d) malloc %d bytes\n",ptr,an++,size);
  993.   #  endif
  994.   #endif
  995.       if (ptr != Nullch)
  996.       return ptr;
  997.       else {
  998.       fputs(nomem,stderr) FLUSH;
  999.       exit(1);
  1000. --- 103,120 ----
  1001.   #endif
  1002.       ptr = malloc(size?size:1);    /* malloc(0) is NASTY on our system */
  1003.   #ifdef DEBUGGING
  1004. ! #  if !(defined(I286) || defined(atarist))
  1005.       if (debug & 128)
  1006. !     fprintf(stderr,"0x%x: (%05d) malloc %ld bytes\n",ptr,an++,(long)size);
  1007.   #  else
  1008.       if (debug & 128)
  1009. !     fprintf(stderr,"0x%lx: (%05d) malloc %ld bytes\n",ptr,an++,(long)size);
  1010.   #  endif
  1011.   #endif
  1012.       if (ptr != Nullch)
  1013.       return ptr;
  1014. +     else if (nomemok)
  1015. +     return Nullch;
  1016.       else {
  1017.       fputs(nomem,stderr) FLUSH;
  1018.       exit(1);
  1019. ***************
  1020. *** 146,165 ****
  1021.   #endif
  1022.       ptr = realloc(where,size?size:1);    /* realloc(0) is NASTY on our system */
  1023.   #ifdef DEBUGGING
  1024. ! #  ifndef I286
  1025.       if (debug & 128) {
  1026.       fprintf(stderr,"0x%x: (%05d) rfree\n",where,an++);
  1027. !     fprintf(stderr,"0x%x: (%05d) realloc %d bytes\n",ptr,an++,size);
  1028.       }
  1029.   #  else
  1030.       if (debug & 128) {
  1031.       fprintf(stderr,"0x%lx: (%05d) rfree\n",where,an++);
  1032. !     fprintf(stderr,"0x%lx: (%05d) realloc %d bytes\n",ptr,an++,size);
  1033.       }
  1034.   #  endif
  1035.   #endif
  1036.       if (ptr != Nullch)
  1037.       return ptr;
  1038.       else {
  1039.       fputs(nomem,stderr) FLUSH;
  1040.       exit(1);
  1041. --- 155,176 ----
  1042.   #endif
  1043.       ptr = realloc(where,size?size:1);    /* realloc(0) is NASTY on our system */
  1044.   #ifdef DEBUGGING
  1045. ! #  if !(defined(I286) || defined(atarist))
  1046.       if (debug & 128) {
  1047.       fprintf(stderr,"0x%x: (%05d) rfree\n",where,an++);
  1048. !     fprintf(stderr,"0x%x: (%05d) realloc %ld bytes\n",ptr,an++,(long)size);
  1049.       }
  1050.   #  else
  1051.       if (debug & 128) {
  1052.       fprintf(stderr,"0x%lx: (%05d) rfree\n",where,an++);
  1053. !     fprintf(stderr,"0x%lx: (%05d) realloc %ld bytes\n",ptr,an++,(long)size);
  1054.       }
  1055.   #  endif
  1056.   #endif
  1057.       if (ptr != Nullch)
  1058.       return ptr;
  1059. +     else if (nomemok)
  1060. +     return Nullch;
  1061.       else {
  1062.       fputs(nomem,stderr) FLUSH;
  1063.       exit(1);
  1064. ***************
  1065. *** 177,183 ****
  1066.   char *where;
  1067.   {
  1068.   #ifdef DEBUGGING
  1069. ! #  ifndef I286
  1070.       if (debug & 128)
  1071.       fprintf(stderr,"0x%x: (%05d) free\n",where,an++);
  1072.   #  else
  1073. --- 188,194 ----
  1074.   char *where;
  1075.   {
  1076.   #ifdef DEBUGGING
  1077. ! #  if !(defined(I286) || defined(atarist))
  1078.       if (debug & 128)
  1079.       fprintf(stderr,"0x%x: (%05d) free\n",where,an++);
  1080.   #  else
  1081. ***************
  1082. *** 233,238 ****
  1083. --- 244,250 ----
  1084.       safefree(where);
  1085.   }
  1086.   
  1087. + static void
  1088.   xstat()
  1089.   {
  1090.       register int i;
  1091. ***************
  1092. *** 820,826 ****
  1093.       register char *newaddr;
  1094.   
  1095.       New(903,newaddr,len+1,char);
  1096. !     (void)bcopy(str,newaddr,len);    /* might not be null terminated */
  1097.       newaddr[len] = '\0';        /* is now */
  1098.       return newaddr;
  1099.   }
  1100. --- 832,838 ----
  1101.       register char *newaddr;
  1102.   
  1103.       New(903,newaddr,len+1,char);
  1104. !     Copy(str,newaddr,len,char);        /* might not be null terminated */
  1105.       newaddr[len] = '\0';        /* is now */
  1106.       return newaddr;
  1107.   }
  1108. ***************
  1109. *** 844,849 ****
  1110. --- 856,862 ----
  1111.   
  1112.   #ifndef I_VARARGS
  1113.   /*VARARGS1*/
  1114. + char *
  1115.   mess(pat,a1,a2,a3,a4)
  1116.   char *pat;
  1117.   long a1, a2, a3, a4;
  1118. ***************
  1119. *** 873,879 ****
  1120.           stab_io(last_in_stab) &&
  1121.           stab_io(last_in_stab)->lines ) {
  1122.           (void)sprintf(s,", <%s> line %ld",
  1123. !           last_in_stab == argvstab ? "" : stab_name(last_in_stab),
  1124.             (long)stab_io(last_in_stab)->lines);
  1125.           s += strlen(s);
  1126.       }
  1127. --- 886,892 ----
  1128.           stab_io(last_in_stab) &&
  1129.           stab_io(last_in_stab)->lines ) {
  1130.           (void)sprintf(s,", <%s> line %ld",
  1131. !           last_in_stab == argvstab ? "" : stab_ename(last_in_stab),
  1132.             (long)stab_io(last_in_stab)->lines);
  1133.           s += strlen(s);
  1134.       }
  1135. ***************
  1136. *** 888,894 ****
  1137.   }
  1138.   
  1139.   /*VARARGS1*/
  1140. ! fatal(pat,a1,a2,a3,a4)
  1141.   char *pat;
  1142.   long a1, a2, a3, a4;
  1143.   {
  1144. --- 901,907 ----
  1145.   }
  1146.   
  1147.   /*VARARGS1*/
  1148. ! void fatal(pat,a1,a2,a3,a4)
  1149.   char *pat;
  1150.   long a1, a2, a3, a4;
  1151.   {
  1152. ***************
  1153. *** 932,938 ****
  1154.   }
  1155.   
  1156.   /*VARARGS1*/
  1157. ! warn(pat,a1,a2,a3,a4)
  1158.   char *pat;
  1159.   long a1, a2, a3, a4;
  1160.   {
  1161. --- 945,951 ----
  1162.   }
  1163.   
  1164.   /*VARARGS1*/
  1165. ! void warn(pat,a1,a2,a3,a4)
  1166.   char *pat;
  1167.   long a1, a2, a3, a4;
  1168.   {
  1169. ***************
  1170. *** 1009,1015 ****
  1171.   }
  1172.   
  1173.   /*VARARGS0*/
  1174. ! fatal(va_alist)
  1175.   va_dcl
  1176.   {
  1177.       va_list args;
  1178. --- 1022,1028 ----
  1179.   }
  1180.   
  1181.   /*VARARGS0*/
  1182. ! void fatal(va_alist)
  1183.   va_dcl
  1184.   {
  1185.       va_list args;
  1186. ***************
  1187. *** 1059,1065 ****
  1188.   }
  1189.   
  1190.   /*VARARGS0*/
  1191. ! warn(va_alist)
  1192.   va_dcl
  1193.   {
  1194.       va_list args;
  1195. --- 1072,1078 ----
  1196.   }
  1197.   
  1198.   /*VARARGS0*/
  1199. ! void warn(va_alist)
  1200.   va_dcl
  1201.   {
  1202.       va_list args;
  1203. ***************
  1204. *** 1085,1091 ****
  1205.   #endif
  1206.   
  1207.   void
  1208. ! setenv(nam,val)
  1209.   char *nam, *val;
  1210.   {
  1211.       register int i=envix(nam);        /* where does it go? */
  1212. --- 1098,1104 ----
  1213.   #endif
  1214.   
  1215.   void
  1216. ! my_setenv(nam,val)
  1217.   char *nam, *val;
  1218.   {
  1219.       register int i=envix(nam);        /* where does it go? */
  1220. ***************
  1221. *** 1144,1149 ****
  1222. --- 1157,1163 ----
  1223.   }
  1224.   
  1225.   #ifdef EUNICE
  1226. + int
  1227.   unlnk(f)    /* unlink all versions of a file */
  1228.   char *f;
  1229.   {
  1230. ***************
  1231. *** 1154,1163 ****
  1232.   }
  1233.   #endif
  1234.   
  1235. ! #ifndef HAS_MEMCPY
  1236. ! #ifndef HAS_BCOPY
  1237.   char *
  1238. ! bcopy(from,to,len)
  1239.   register char *from;
  1240.   register char *to;
  1241.   register int len;
  1242. --- 1168,1176 ----
  1243.   }
  1244.   #endif
  1245.   
  1246. ! #if !defined(HAS_BCOPY) || !defined(SAFE_BCOPY)
  1247.   char *
  1248. ! my_bcopy(from,to,len)
  1249.   register char *from;
  1250.   register char *to;
  1251.   register int len;
  1252. ***************
  1253. *** 1164,1178 ****
  1254.   {
  1255.       char *retval = to;
  1256.   
  1257. !     while (len--)
  1258. !     *to++ = *from++;
  1259.       return retval;
  1260.   }
  1261.   #endif
  1262.   
  1263. ! #ifndef HAS_BZERO
  1264.   char *
  1265. ! bzero(loc,len)
  1266.   register char *loc;
  1267.   register int len;
  1268.   {
  1269. --- 1177,1199 ----
  1270.   {
  1271.       char *retval = to;
  1272.   
  1273. !     if (from - to >= 0) {
  1274. !     while (len--)
  1275. !         *to++ = *from++;
  1276. !     }
  1277. !     else {
  1278. !     to += len;
  1279. !     from += len;
  1280. !     while (len--)
  1281. !         --*to = --*from;
  1282. !     }
  1283.       return retval;
  1284.   }
  1285.   #endif
  1286.   
  1287. ! #if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
  1288.   char *
  1289. ! my_bzero(loc,len)
  1290.   register char *loc;
  1291.   register int len;
  1292.   {
  1293. ***************
  1294. *** 1183,1190 ****
  1295.       return retval;
  1296.   }
  1297.   #endif
  1298. - #endif
  1299.   
  1300.   #ifdef I_VARARGS
  1301.   #ifndef HAS_VPRINTF
  1302.   
  1303. --- 1204,1227 ----
  1304.       return retval;
  1305.   }
  1306.   #endif
  1307.   
  1308. + #ifndef HAS_MEMCMP
  1309. + int
  1310. + my_memcmp(s1,s2,len)
  1311. + register unsigned char *s1;
  1312. + register unsigned char *s2;
  1313. + register int len;
  1314. + {
  1315. +     register int tmp;
  1316. +     while (len--) {
  1317. +     if (tmp = *s1++ - *s2++)
  1318. +         return tmp;
  1319. +     }
  1320. +     return 0;
  1321. + }
  1322. + #endif /* HAS_MEMCMP */
  1323.   #ifdef I_VARARGS
  1324.   #ifndef HAS_VPRINTF
  1325.   
  1326. ***************
  1327. *** 1372,1378 ****
  1328.   VTOH(vtohl,long)
  1329.   #endif
  1330.   
  1331. ! #ifndef MSDOS
  1332.   FILE *
  1333.   mypopen(cmd,mode)
  1334.   char    *cmd;
  1335. --- 1409,1415 ----
  1336.   VTOH(vtohl,long)
  1337.   #endif
  1338.   
  1339. ! #ifndef DOSISH
  1340.   FILE *
  1341.   mypopen(cmd,mode)
  1342.   char    *cmd;
  1343. ***************
  1344. *** 1446,1453 ****
  1345.       forkprocess = pid;
  1346.       return fdopen(p[this], mode);
  1347.   }
  1348. ! #endif /* !MSDOS */
  1349.   
  1350.   #ifdef NOTDEF
  1351.   dumpfds(s)
  1352.   char *s;
  1353. --- 1483,1502 ----
  1354.       forkprocess = pid;
  1355.       return fdopen(p[this], mode);
  1356.   }
  1357. ! #else
  1358. ! #ifdef atarist
  1359. ! FILE *popen();
  1360. ! FILE *
  1361. ! mypopen(cmd,mode)
  1362. ! char    *cmd;
  1363. ! char    *mode;
  1364. ! {
  1365. !     return popen(cmd, mode);
  1366. ! }
  1367. ! #endif
  1368.   
  1369. + #endif /* !DOSISH */
  1370.   #ifdef NOTDEF
  1371.   dumpfds(s)
  1372.   char *s;
  1373. ***************
  1374. *** 1488,1494 ****
  1375.   }
  1376.   #endif
  1377.   
  1378. ! #ifndef MSDOS
  1379.   int
  1380.   mypclose(ptr)
  1381.   FILE *ptr;
  1382. --- 1537,1543 ----
  1383.   }
  1384.   #endif
  1385.   
  1386. ! #ifndef DOSISH
  1387.   int
  1388.   mypclose(ptr)
  1389.   FILE *ptr;
  1390. ***************
  1391. *** 1506,1511 ****
  1392. --- 1555,1563 ----
  1393.       pid = (int)str->str_u.str_useful;
  1394.       astore(fdpid,fileno(ptr),Nullstr);
  1395.       fclose(ptr);
  1396. + #ifdef UTS
  1397. +     if(kill(pid, 0) < 0) { return(pid); }   /* HOM 12/23/91 */
  1398. + #endif
  1399.       hstat = signal(SIGHUP, SIG_IGN);
  1400.       istat = signal(SIGINT, SIG_IGN);
  1401.       qstat = signal(SIGQUIT, SIG_IGN);
  1402. ***************
  1403. *** 1551,1557 ****
  1404.       hiterinit(pidstatus);
  1405.       if (entry = hiternext(pidstatus)) {
  1406.           pid = atoi(hiterkey(entry,statusp));
  1407. !         str = hiterval(entry);
  1408.           *statusp = (int)str->str_u.str_useful;
  1409.           sprintf(spid, "%d", pid);
  1410.           hdelete(pidstatus,spid,strlen(spid));
  1411. --- 1603,1609 ----
  1412.       hiterinit(pidstatus);
  1413.       if (entry = hiternext(pidstatus)) {
  1414.           pid = atoi(hiterkey(entry,statusp));
  1415. !         str = hiterval(pidstatus,entry);
  1416.           *statusp = (int)str->str_u.str_useful;
  1417.           sprintf(spid, "%d", pid);
  1418.           hdelete(pidstatus,spid,strlen(spid));
  1419. ***************
  1420. *** 1570,1576 ****
  1421. --- 1622,1630 ----
  1422.   #endif
  1423.   #endif
  1424.   }
  1425. + #endif /* !DOSISH */
  1426.   
  1427. + void
  1428.   /*SUPPRESS 590*/
  1429.   pidgone(pid,status)
  1430.   int pid;
  1431. ***************
  1432. *** 1587,1609 ****
  1433.   #endif
  1434.       return;
  1435.   }
  1436. - #endif /* !MSDOS */
  1437.   
  1438. ! #ifndef HAS_MEMCMP
  1439. ! memcmp(s1,s2,len)
  1440. ! register unsigned char *s1;
  1441. ! register unsigned char *s2;
  1442. ! register int len;
  1443.   {
  1444. !     register int tmp;
  1445. !     while (len--) {
  1446. !     if (tmp = *s1++ - *s2++)
  1447. !         return tmp;
  1448. !     }
  1449. !     return 0;
  1450.   }
  1451. ! #endif /* HAS_MEMCMP */
  1452.   
  1453.   void
  1454.   repeatcpy(to,from,len,count)
  1455. --- 1641,1656 ----
  1456.   #endif
  1457.       return;
  1458.   }
  1459.   
  1460. ! #ifdef atarist
  1461. ! int pclose();
  1462. ! int
  1463. ! mypclose(ptr)
  1464. ! FILE *ptr;
  1465.   {
  1466. !     return pclose(ptr);
  1467.   }
  1468. ! #endif
  1469.   
  1470.   void
  1471.   repeatcpy(to,from,len,count)
  1472.  
  1473. Index: util.h
  1474. *** util.h.old    Mon Jun  8 17:52:38 1992
  1475. --- util.h    Mon Jun  8 17:52:39 1992
  1476. ***************
  1477. *** 1,4 ****
  1478. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:18:40 $
  1479.    *
  1480.    *    Copyright (c) 1991, Larry Wall
  1481.    *
  1482. --- 1,4 ----
  1483. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.3 $$Date: 92/06/08 16:09:20 $
  1484.    *
  1485.    *    Copyright (c) 1991, Larry Wall
  1486.    *
  1487. ***************
  1488. *** 6,11 ****
  1489. --- 6,14 ----
  1490.    *    License or the Artistic License, as specified in the README file.
  1491.    *
  1492.    * $Log:    util.h,v $
  1493. +  * Revision 4.0.1.3  92/06/08  16:09:20  lwall
  1494. +  * patch20: bcopy() and memcpy() now tested for overlap safety
  1495. +  * 
  1496.    * Revision 4.0.1.2  91/11/05  19:18:40  lwall
  1497.    * patch11: safe malloc code now integrated into Perl's malloc when possible
  1498.    * 
  1499. ***************
  1500. *** 30,36 ****
  1501.   char    *screaminstr();
  1502.   void    fbmcompile();
  1503.   char    *savestr();
  1504. ! void    setenv();
  1505.   int    envix();
  1506.   void    growstr();
  1507.   char    *ninstr();
  1508. --- 33,39 ----
  1509.   char    *screaminstr();
  1510.   void    fbmcompile();
  1511.   char    *savestr();
  1512. ! void    my_setenv();
  1513.   int    envix();
  1514.   void    growstr();
  1515.   char    *ninstr();
  1516. ***************
  1517. *** 38,50 ****
  1518.   char    *nsavestr();
  1519.   FILE    *mypopen();
  1520.   int    mypclose();
  1521. ! #ifndef HAS_MEMCPY
  1522. ! #ifndef HAS_BCOPY
  1523. ! char    *bcopy();
  1524.   #endif
  1525. ! #ifndef HAS_BZERO
  1526. ! char    *bzero();
  1527.   #endif
  1528.   #endif
  1529.   unsigned long scanoct();
  1530.   unsigned long scanhex();
  1531. --- 41,54 ----
  1532.   char    *nsavestr();
  1533.   FILE    *mypopen();
  1534.   int    mypclose();
  1535. ! #if !defined(HAS_BCOPY) || !defined(SAFE_BCOPY)
  1536. ! char    *my_bcopy();
  1537.   #endif
  1538. ! #if !defined(HAS_BZERO) && !defined(HAS_MEMSET)
  1539. ! char    *my_bzero();
  1540.   #endif
  1541. + #ifndef HAS_MEMCMP
  1542. + int    my_memcmp();
  1543.   #endif
  1544.   unsigned long scanoct();
  1545.   unsigned long scanhex();
  1546.  
  1547. Index: hints/uts.sh
  1548. *** hints/uts.sh.old    Mon Jun  8 17:48:33 1992
  1549. --- hints/uts.sh    Mon Jun  8 17:48:34 1992
  1550. ***************
  1551. *** 1,2 ****
  1552.   ccflags="$ccflags -DCRIPPLED_CC"
  1553. ! d_lstat=$define
  1554. --- 1,2 ----
  1555.   ccflags="$ccflags -DCRIPPLED_CC"
  1556. ! d_lstat=define
  1557.  
  1558. Index: x2p/walk.c
  1559. *** x2p/walk.c.old    Mon Jun  8 17:53:03 1992
  1560. --- x2p/walk.c    Mon Jun  8 17:53:03 1992
  1561. ***************
  1562. *** 1,4 ****
  1563. ! /* $RCSfile: walk.c,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:25:09 $
  1564.    *
  1565.    *    Copyright (c) 1991, Larry Wall
  1566.    *
  1567. --- 1,4 ----
  1568. ! /* $RCSfile: walk.c,v $$Revision: 4.0.1.3 $$Date: 92/06/08 17:33:46 $
  1569.    *
  1570.    *    Copyright (c) 1991, Larry Wall
  1571.    *
  1572. ***************
  1573. *** 6,11 ****
  1574. --- 6,17 ----
  1575.    *    License or the Artistic License, as specified in the README file.
  1576.    *
  1577.    * $Log:    walk.c,v $
  1578. +  * Revision 4.0.1.3  92/06/08  17:33:46  lwall
  1579. +  * patch20: in a2p, simplified the filehandle model
  1580. +  * patch20: in a2p, made RS="" translate to $/ = "\n\n"
  1581. +  * patch20: in a2p, do {...} while ... was missing some reconstruction code
  1582. +  * patch20: in a2p, getline should allow variable to be array element
  1583. +  * 
  1584.    * Revision 4.0.1.2  91/11/05  19:25:09  lwall
  1585.    * patch11: in a2p, split on whitespace produced extra null field
  1586.    * 
  1587. ***************
  1588. *** 211,221 ****
  1589.           str_cat(str,"\n\
  1590.   sub Pick {\n\
  1591.       local($mode,$name,$pipe) = @_;\n\
  1592. !     $fh = $opened{$name};\n\
  1593. !     if (!$fh) {\n\
  1594. !     $fh = $opened{$name} = 'fh_' . ($nextfh++ + 0);\n\
  1595. !     open($fh,$mode.$name.$pipe);\n\
  1596. !     }\n\
  1597.   }\n\
  1598.   ");
  1599.       }
  1600. --- 217,224 ----
  1601.           str_cat(str,"\n\
  1602.   sub Pick {\n\
  1603.       local($mode,$name,$pipe) = @_;\n\
  1604. !     $fh = $name;\n\
  1605. !     open($name,$mode.$name.$pipe) unless $opened{$name}++;\n\
  1606.   }\n\
  1607.   ");
  1608.       }
  1609. ***************
  1610. *** 468,473 ****
  1611. --- 471,478 ----
  1612.       str_scat(str,fstr=walk(1,level,ops[node+3].ival,&numarg,prec));
  1613.       str_free(fstr);
  1614.       numeric |= numarg;
  1615. +     if (strEQ(str->str_ptr,"$/ = ''"))
  1616. +         str_set(str, "$/ = \"\\n\\n\"");
  1617.       break;
  1618.       case OADD:
  1619.       prec = P_ADD;
  1620. ***************
  1621. *** 570,579 ****
  1622.       if (useval)
  1623.           str_cat(str,"(");
  1624.       if (len > 0) {
  1625. -         str_cat(str,"$");
  1626.           str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN));
  1627.           if (!*fstr->str_ptr) {
  1628. !         str_cat(str,"_");
  1629.           len = 2;        /* a legal fiction */
  1630.           }
  1631.           str_free(fstr);
  1632. --- 575,583 ----
  1633.       if (useval)
  1634.           str_cat(str,"(");
  1635.       if (len > 0) {
  1636.           str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN));
  1637.           if (!*fstr->str_ptr) {
  1638. !         str_cat(str,"$_");
  1639.           len = 2;        /* a legal fiction */
  1640.           }
  1641.           str_free(fstr);
  1642. ***************
  1643. *** 1137,1144 ****
  1644.           str_cat(str,tokenbuf);
  1645.       }
  1646.       else {
  1647. !         sprintf(tokenbuf,"$fh = delete $opened{%s} && close($fh)",
  1648. !            tmpstr->str_ptr);
  1649.           str_free(tmpstr);
  1650.           str_set(str,tokenbuf);
  1651.       }
  1652. --- 1141,1148 ----
  1653.           str_cat(str,tokenbuf);
  1654.       }
  1655.       else {
  1656. !         sprintf(tokenbuf,"delete $opened{%s} && close(%s)",
  1657. !            tmpstr->str_ptr, tmpstr->str_ptr);
  1658.           str_free(tmpstr);
  1659.           str_set(str,tokenbuf);
  1660.       }
  1661. ***************
  1662. *** 1414,1419 ****
  1663. --- 1418,1435 ----
  1664.       str_cat(str,") ");
  1665.       str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN));
  1666.       str_free(fstr);
  1667. +     break;
  1668. +     case ODO:
  1669. +     str = str_new(0);
  1670. +     str_set(str,"do ");
  1671. +     str_scat(str,fstr=walk(1,level,ops[node+1].ival,&numarg,P_MIN));
  1672. +     str_free(fstr);
  1673. +     if (str->str_ptr[str->str_cur - 1] == '\n')
  1674. +         --str->str_cur;;
  1675. +     str_cat(str," while (");
  1676. +     str_scat(str,fstr=walk(0,level,ops[node+2].ival,&numarg,P_MIN));
  1677. +     str_free(fstr);
  1678. +     str_cat(str,");");
  1679.       break;
  1680.       case OFOR:
  1681.       str = str_new(0);
  1682.  
  1683. Index: eg/who
  1684. *** eg/who.old    Mon Jun  8 17:47:11 1992
  1685. --- eg/who    Mon Jun  8 17:47:12 1992
  1686. ***************
  1687. *** 5,11 ****
  1688.   while (read(UTMP,$utmp,36)) {
  1689.       ($line,$name,$host,$time) = unpack('A8A8A16l',$utmp);
  1690.       if ($name) {
  1691. !     $host = "($host)" if $host;
  1692.       ($sec,$min,$hour,$mday,$mon) = localtime($time);
  1693.       printf "%-9s%-8s%s %2d %02d:%02d   %s\n",
  1694.         $name,$line,$mo[$mon],$mday,$hour,$min,$host;
  1695. --- 5,11 ----
  1696.   while (read(UTMP,$utmp,36)) {
  1697.       ($line,$name,$host,$time) = unpack('A8A8A16l',$utmp);
  1698.       if ($name) {
  1699. !     $host = "($host)" if ord($host);
  1700.       ($sec,$min,$hour,$mday,$mon) = localtime($time);
  1701.       printf "%-9s%-8s%s %2d %02d:%02d   %s\n",
  1702.         $name,$line,$mo[$mon],$mday,$hour,$min,$host;
  1703.  
  1704. *** End of Patch 32 ***
  1705. exit 0 # Just in case...
  1706.