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

  1. Newsgroups: comp.sources.misc
  2. From: lwall@netlabs.com (Larry Wall)
  3. Subject:  v30i036:  perl - The perl programming language, Patch25
  4. Message-ID: <1992Jun11.180426.453@sparky.imd.sterling.com>
  5. X-Md4-Signature: 4b560f3d04c7edc27e8bfaff209700d2
  6. Date: Thu, 11 Jun 1992 18:04:26 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lwall@netlabs.com (Larry Wall)
  10. Posting-number: Volume 30, Issue 36
  11. Archive-name: perl/patch25
  12. Environment: UNIX, MS-DOS, OS2
  13. Patch-To: perl: Volume 18, Issue 19-54
  14.  
  15. System: perl version 4.0
  16. Patch #: 25
  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: 24
  56. 1c1
  57. < #define PATCHLEVEL 24
  58. ---
  59. > #define PATCHLEVEL 25
  60.  
  61. Index: cons.c
  62. *** cons.c.old    Mon Jun  8 17:46:18 1992
  63. --- cons.c    Mon Jun  8 17:46:19 1992
  64. ***************
  65. *** 1,4 ****
  66. ! /* $RCSfile: cons.c,v $$Revision: 4.0.1.2 $$Date: 91/11/05 16:15:13 $
  67.    *
  68.    *    Copyright (c) 1991, Larry Wall
  69.    *
  70. --- 1,4 ----
  71. ! /* $RCSfile: cons.c,v $$Revision: 4.0.1.3 $$Date: 92/06/08 12:18:35 $
  72.    *
  73.    *    Copyright (c) 1991, Larry Wall
  74.    *
  75. ***************
  76. *** 6,11 ****
  77. --- 6,21 ----
  78.    *    License or the Artistic License, as specified in the README file.
  79.    *
  80.    * $Log:    cons.c,v $
  81. +  * Revision 4.0.1.3  92/06/08  12:18:35  lwall
  82. +  * patch20: removed implicit int declarations on funcions
  83. +  * patch20: deleted some minor memory leaks
  84. +  * patch20: fixed double debug break in foreach with implicit array assignment
  85. +  * patch20: fixed confusion between a *var's real name and its effective name
  86. +  * patch20: Perl now distinguishes overlapped copies from non-overlapped
  87. +  * patch20: debugger sometimes displayed wrong source line
  88. +  * patch20: various error messages have been clarified
  89. +  * patch20: an eval block containing a null block or statement could dump core
  90. +  * 
  91.    * Revision 4.0.1.2  91/11/05  16:15:13  lwall
  92.    * patch11: debugger got confused over nested subroutine definitions
  93.    * patch11: prepared for ctype implementations that don't define isascii()
  94. ***************
  95. *** 29,34 ****
  96. --- 39,46 ----
  97.   static int cmd_tosave();
  98.   static int arg_tosave();
  99.   static int spat_tosave();
  100. + static void make_cswitch();
  101. + static void make_nswitch();
  102.   
  103.   static bool saw_return;
  104.   
  105. ***************
  106. *** 40,47 ****
  107.       register SUBR *sub;
  108.       STAB *stab = stabent(name,TRUE);
  109.   
  110. !     Newz(101,sub,1,SUBR);
  111. !     if (stab_sub(stab)) {
  112.       if (dowarn) {
  113.           CMD *oldcurcmd = curcmd;
  114.   
  115. --- 52,58 ----
  116.       register SUBR *sub;
  117.       STAB *stab = stabent(name,TRUE);
  118.   
  119. !     if (sub = stab_sub(stab)) {
  120.       if (dowarn) {
  121.           CMD *oldcurcmd = curcmd;
  122.   
  123. ***************
  124. *** 50,62 ****
  125.           warn("Subroutine %s redefined",name);
  126.           curcmd = oldcurcmd;
  127.       }
  128. !     if (stab_sub(stab)->cmd) {
  129. !         cmd_free(stab_sub(stab)->cmd);
  130. !         stab_sub(stab)->cmd = Nullcmd;
  131. !         afree(stab_sub(stab)->tosave);
  132.       }
  133. !     Safefree(stab_sub(stab));
  134.       }
  135.       stab_sub(stab) = sub;
  136.       sub->filestab = curcmd->c_filestab;
  137.       saw_return = FALSE;
  138. --- 61,74 ----
  139.           warn("Subroutine %s redefined",name);
  140.           curcmd = oldcurcmd;
  141.       }
  142. !     if (!sub->usersub && sub->cmd) {
  143. !         cmd_free(sub->cmd);
  144. !         sub->cmd = Nullcmd;
  145. !         afree(sub->tosave);
  146.       }
  147. !     Safefree(sub);
  148.       }
  149. +     Newz(101,sub,1,SUBR);
  150.       stab_sub(stab) = sub;
  151.       sub->filestab = curcmd->c_filestab;
  152.       saw_return = FALSE;
  153. ***************
  154. *** 69,75 ****
  155.   
  156.       mycompblock.comp_true = cmd;
  157.       mycompblock.comp_alt = Nullcmd;
  158. !     cmd = add_label(savestr("_SUB_"),make_ccmd(C_BLOCK,Nullarg,mycompblock));
  159.       saw_return = FALSE;
  160.       cmd->c_flags |= CF_TERM;
  161.       }
  162. --- 81,88 ----
  163.   
  164.       mycompblock.comp_true = cmd;
  165.       mycompblock.comp_alt = Nullcmd;
  166. !     cmd = add_label(savestr("_SUB_"),make_ccmd(C_BLOCK,0,
  167. !         Nullarg,mycompblock));
  168.       saw_return = FALSE;
  169.       cmd->c_flags |= CF_TERM;
  170.       }
  171. ***************
  172. *** 83,92 ****
  173.       str_cat(str,"-");
  174.       sprintf(buf,"%ld",(long)curcmd->c_line);
  175.       str_cat(str,buf);
  176. !     name = str_get(subname);
  177. !     stab_fullname(tmpstr,stab);
  178.       hstore(stab_xhash(DBsub), tmpstr->str_ptr, tmpstr->str_cur, str, 0);
  179.       }
  180.       return sub;
  181.   }
  182.   
  183. --- 96,105 ----
  184.       str_cat(str,"-");
  185.       sprintf(buf,"%ld",(long)curcmd->c_line);
  186.       str_cat(str,buf);
  187. !     stab_efullname(tmpstr,stab);
  188.       hstore(stab_xhash(DBsub), tmpstr->str_ptr, tmpstr->str_cur, str, 0);
  189.       }
  190. +     Safefree(name);
  191.       return sub;
  192.   }
  193.   
  194. ***************
  195. *** 102,118 ****
  196.   
  197.       if (!stab)                /* unused function */
  198.       return Null(SUBR*);
  199. !     Newz(101,sub,1,SUBR);
  200. !     if (stab_sub(stab)) {
  201.       if (dowarn)
  202.           warn("Subroutine %s redefined",name);
  203. !     if (stab_sub(stab)->cmd) {
  204. !         cmd_free(stab_sub(stab)->cmd);
  205. !         stab_sub(stab)->cmd = Nullcmd;
  206. !         afree(stab_sub(stab)->tosave);
  207.       }
  208. !     Safefree(stab_sub(stab));
  209.       }
  210.       stab_sub(stab) = sub;
  211.       sub->filestab = fstab(filename);
  212.       sub->usersub = subaddr;
  213. --- 115,131 ----
  214.   
  215.       if (!stab)                /* unused function */
  216.       return Null(SUBR*);
  217. !     if (sub = stab_sub(stab)) {
  218.       if (dowarn)
  219.           warn("Subroutine %s redefined",name);
  220. !     if (!sub->usersub && sub->cmd) {
  221. !         cmd_free(sub->cmd);
  222. !         sub->cmd = Nullcmd;
  223. !         afree(sub->tosave);
  224.       }
  225. !     Safefree(sub);
  226.       }
  227. +     Newz(101,sub,1,SUBR);
  228.       stab_sub(stab) = sub;
  229.       sub->filestab = fstab(filename);
  230.       sub->usersub = subaddr;
  231. ***************
  232. *** 120,125 ****
  233. --- 133,139 ----
  234.       return sub;
  235.   }
  236.   
  237. + void
  238.   make_form(stab,fcmd)
  239.   STAB *stab;
  240.   FCMD *fcmd;
  241. ***************
  242. *** 188,198 ****
  243.       /* now do a little optimization on case-ish structures */
  244.       switch(tail->c_flags & (CF_OPTIMIZE|CF_FIRSTNEG|CF_INVERT)) {
  245.       case CFT_ANCHOR:
  246. -         if (stabent("*",FALSE)) {    /* bad assumption here!!! */
  247. -         opt = 0;
  248. -         break;
  249. -         }
  250. -         /* FALL THROUGH */
  251.       case CFT_STROP:
  252.           opt = (tail->c_flags & CF_NESURE) ? CFT_STROP : 0;
  253.           break;
  254. --- 202,207 ----
  255. ***************
  256. *** 239,244 ****
  257. --- 248,254 ----
  258.    * spat.  Thus we can insert a SWITCH in front and jump directly
  259.    * to the correct one.
  260.    */
  261. + static void
  262.   make_cswitch(head,count)
  263.   register CMD *head;
  264.   int count;
  265. ***************
  266. *** 251,262 ****
  267.   
  268.       /* make a new head in the exact same spot */
  269.       New(102,cur, 1, CMD);
  270. ! #ifdef STRUCTCOPY
  271. !     *cur = *head;
  272. ! #else
  273. !     Copy(head,cur,1,CMD);
  274. ! #endif
  275.       Zero(head,1,CMD);
  276.       head->c_type = C_CSWITCH;
  277.       head->c_next = cur;        /* insert new cmd at front of list */
  278.       head->c_stab = cur->c_stab;
  279. --- 261,269 ----
  280.   
  281.       /* make a new head in the exact same spot */
  282.       New(102,cur, 1, CMD);
  283. !     StructCopy(head,cur,CMD);
  284.       Zero(head,1,CMD);
  285. +     head->c_head = cur->c_head;
  286.       head->c_type = C_CSWITCH;
  287.       head->c_next = cur;        /* insert new cmd at front of list */
  288.       head->c_stab = cur->c_stab;
  289. ***************
  290. *** 289,295 ****
  291.       }
  292.       max++;
  293.       if (min > 0)
  294. !     Copy(&loc[min],&loc[0], max - min, CMD*);
  295.       loc--;
  296.       min--;
  297.       max -= min;
  298. --- 296,302 ----
  299.       }
  300.       max++;
  301.       if (min > 0)
  302. !     Move(&loc[min],&loc[0], max - min, CMD*);
  303.       loc--;
  304.       min--;
  305.       max -= min;
  306. ***************
  307. *** 302,307 ****
  308. --- 309,315 ----
  309.       head->ucmd.scmd.sc_next = loc;
  310.   }
  311.   
  312. + static void
  313.   make_nswitch(head,count)
  314.   register CMD *head;
  315.   int count;
  316. ***************
  317. *** 339,350 ****
  318.   
  319.       /* now make a new head in the exact same spot */
  320.       New(104,cur, 1, CMD);
  321. ! #ifdef STRUCTCOPY
  322. !     *cur = *head;
  323. ! #else
  324. !     Copy(head,cur,1,CMD);
  325. ! #endif
  326.       Zero(head,1,CMD);
  327.       head->c_type = C_NSWITCH;
  328.       head->c_next = cur;        /* insert new cmd at front of list */
  329.       head->c_stab = cur->c_stab;
  330. --- 347,355 ----
  331.   
  332.       /* now make a new head in the exact same spot */
  333.       New(104,cur, 1, CMD);
  334. !     StructCopy(head,cur,CMD);
  335.       Zero(head,1,CMD);
  336. +     head->c_head = cur->c_head;
  337.       head->c_type = C_NSWITCH;
  338.       head->c_next = cur;        /* insert new cmd at front of list */
  339.       head->c_stab = cur->c_stab;
  340. ***************
  341. *** 443,448 ****
  342. --- 448,454 ----
  343.       stab2arg(A_WORD,DBstab),
  344.       Nullarg,
  345.       Nullarg);
  346. +     /*SUPPRESS 53*/
  347.       cmd->c_flags |= CF_COND|CF_DBSUB|CFT_D0;
  348.       cmd->c_line = head->c_line;
  349.       cmd->c_label = head->c_label;
  350. ***************
  351. *** 481,488 ****
  352.   }
  353.   
  354.   CMD *
  355. ! make_ccmd(type,arg,cblock)
  356.   int type;
  357.   ARG *arg;
  358.   struct compcmd cblock;
  359.   {
  360. --- 487,495 ----
  361.   }
  362.   
  363.   CMD *
  364. ! make_ccmd(type,debuggable,arg,cblock)
  365.   int type;
  366. + int debuggable;
  367.   ARG *arg;
  368.   struct compcmd cblock;
  369.   {
  370. ***************
  371. *** 503,509 ****
  372.       }
  373.       cmd->c_filestab = curcmd->c_filestab;
  374.       cmd->c_stash = curstash;
  375. !     if (perldb)
  376.       cmd = dodb(cmd);
  377.       return cmd;
  378.   }
  379. --- 510,516 ----
  380.       }
  381.       cmd->c_filestab = curcmd->c_filestab;
  382.       cmd->c_stash = curstash;
  383. !     if (perldb && debuggable)
  384.       cmd = dodb(cmd);
  385.       return cmd;
  386.   }
  387. ***************
  388. *** 545,551 ****
  389.       if (alt) {            /* a real life ELSE at the end? */
  390.       ncblock.comp_true = alt;
  391.       ncblock.comp_alt = Nullcmd;
  392. !     alt = append_line(cur,make_ccmd(C_ELSE,Nullarg,ncblock));
  393.       cur->ucmd.ccmd.cc_alt = alt;
  394.       }
  395.       else
  396. --- 552,558 ----
  397.       if (alt) {            /* a real life ELSE at the end? */
  398.       ncblock.comp_true = alt;
  399.       ncblock.comp_alt = Nullcmd;
  400. !     alt = append_line(cur,make_ccmd(C_ELSE,1,Nullarg,ncblock));
  401.       cur->ucmd.ccmd.cc_alt = alt;
  402.       }
  403.       else
  404. ***************
  405. *** 693,698 ****
  406. --- 700,706 ----
  407.           sure |= CF_EQSURE;        /* (SUBST must be forced even */
  408.                           /* if we know it will work.) */
  409.           if (arg->arg_type != O_SUBST) {
  410. +         str_free(arg[2].arg_ptr.arg_spat->spat_short);
  411.           arg[2].arg_ptr.arg_spat->spat_short = Nullstr;
  412.           arg[2].arg_ptr.arg_spat->spat_slen = 0; /* only one chk */
  413.           }
  414. ***************
  415. *** 901,906 ****
  416. --- 909,926 ----
  417.       return cmd;
  418.   }
  419.   
  420. + void
  421. + cpy7bit(d,s,l)
  422. + register char *d;
  423. + register char *s;
  424. + register int l;
  425. + {
  426. +     while (l--)
  427. +     *d++ = *s++ & 127;
  428. +     *d = '\0';
  429. + }
  430. + int
  431.   yyerror(s)
  432.   char *s;
  433.   {
  434. ***************
  435. *** 912,919 ****
  436.         oldoldbufptr != oldbufptr && oldbufptr != bufptr) {
  437.       while (isSPACE(*oldoldbufptr))
  438.           oldoldbufptr++;
  439. !     strncpy(tmp2buf, oldoldbufptr, bufptr - oldoldbufptr);
  440. !     tmp2buf[bufptr - oldoldbufptr] = '\0';
  441.       sprintf(tname,"next 2 tokens \"%s\"",tmp2buf);
  442.       }
  443.       else if (bufptr > oldbufptr && bufptr - oldbufptr < 200 &&
  444. --- 932,938 ----
  445.         oldoldbufptr != oldbufptr && oldbufptr != bufptr) {
  446.       while (isSPACE(*oldoldbufptr))
  447.           oldoldbufptr++;
  448. !     cpy7bit(tmp2buf, oldoldbufptr, bufptr - oldoldbufptr);
  449.       sprintf(tname,"next 2 tokens \"%s\"",tmp2buf);
  450.       }
  451.       else if (bufptr > oldbufptr && bufptr - oldbufptr < 200 &&
  452. ***************
  453. *** 920,927 ****
  454.         oldbufptr != bufptr) {
  455.       while (isSPACE(*oldbufptr))
  456.           oldbufptr++;
  457. !     strncpy(tmp2buf, oldbufptr, bufptr - oldbufptr);
  458. !     tmp2buf[bufptr - oldbufptr] = '\0';
  459.       sprintf(tname,"next token \"%s\"",tmp2buf);
  460.       }
  461.       else if (yychar > 256)
  462. --- 939,945 ----
  463.         oldbufptr != bufptr) {
  464.       while (isSPACE(*oldbufptr))
  465.           oldbufptr++;
  466. !     cpy7bit(tmp2buf, oldbufptr, bufptr - oldbufptr);
  467.       sprintf(tname,"next token \"%s\"",tmp2buf);
  468.       }
  469.       else if (yychar > 256)
  470. ***************
  471. *** 1101,1107 ****
  472.       cmd->ucmd.ccmd.cc_alt = tail;    /* every loop has a continue now */
  473.   
  474.   #ifndef lint
  475. !     (void)bcopy((char *)cmd, (char *)tail, sizeof(CMD));
  476.   #endif
  477.       tail->c_type = C_EXPR;
  478.       tail->c_flags ^= CF_INVERT;        /* turn into "last unless" */
  479. --- 1119,1125 ----
  480.       cmd->ucmd.ccmd.cc_alt = tail;    /* every loop has a continue now */
  481.   
  482.   #ifndef lint
  483. !     Copy((char *)cmd, (char *)tail, 1, CMD);
  484.   #endif
  485.       tail->c_type = C_EXPR;
  486.       tail->c_flags ^= CF_INVERT;        /* turn into "last unless" */
  487. ***************
  488. *** 1127,1132 ****
  489. --- 1145,1151 ----
  490.       return cmd;
  491.   }
  492.   
  493. + void
  494.   cmd_free(cmd)
  495.   register CMD *cmd;
  496.   {
  497. ***************
  498. *** 1133,1138 ****
  499. --- 1152,1161 ----
  500.       register CMD *tofree;
  501.       register CMD *head = cmd;
  502.   
  503. +     if (!cmd)
  504. +     return;
  505. +     if (cmd->c_head != cmd)
  506. +     warn("Malformed cmd links\n");
  507.       while (cmd) {
  508.       if (cmd->c_type != C_WHILE) {    /* WHILE block is duplicated */
  509.           if (cmd->c_label) {
  510. ***************
  511. *** 1175,1185 ****
  512. --- 1198,1211 ----
  513.       Safefree(head);
  514.   }
  515.   
  516. + void
  517.   arg_free(arg)
  518.   register ARG *arg;
  519.   {
  520.       register int i;
  521.   
  522. +     if (!arg)
  523. +     return;
  524.       for (i = 1; i <= arg->arg_len; i++) {
  525.       switch (arg[i].arg_type & A_MASK) {
  526.       case A_NULL:
  527. ***************
  528. *** 1231,1236 ****
  529. --- 1257,1263 ----
  530.       free_arg(arg);
  531.   }
  532.   
  533. + void
  534.   spat_free(spat)
  535.   register SPAT *spat;
  536.   {
  537. ***************
  538. *** 1237,1242 ****
  539. --- 1264,1271 ----
  540.       register SPAT *sp;
  541.       HENT *entry;
  542.   
  543. +     if (!spat)
  544. +     return;
  545.       if (spat->spat_runtime) {
  546.       arg_free(spat->spat_runtime);
  547.       spat->spat_runtime = Nullarg;
  548.  
  549. Index: atarist/test/dbm
  550. *** atarist/test/dbm.old    Mon Jun  8 17:44:58 1992
  551. --- atarist/test/dbm    Mon Jun  8 17:44:59 1992
  552. ***************
  553. *** 0 ****
  554. --- 1,124 ----
  555. + die "cant create dbmtest" unless dbmopen(%keys, "dbmtest", 0666);
  556. + print "Writing...\n";
  557. + $keys{'key0'} = 0;
  558. + $keys{'key1'} = 1;
  559. + $keys{'key2'} = 2;
  560. + $keys{'key3'} = 3;
  561. + $keys{'key4'} = 4;
  562. + $keys{'key5'} = 5;
  563. + $keys{'key6'} = 6;
  564. + $keys{'key7'} = 7;
  565. + $keys{'key8'} = 8;
  566. + $keys{'key9'} = 9;
  567. + $keys{'key10'} = 10;
  568. + $keys{'key11'} = 11;
  569. + $keys{'key12'} = 12;
  570. + $keys{'key13'} = 13;
  571. + $keys{'key14'} = 14;
  572. + $keys{'key15'} = 15;
  573. + $keys{'key16'} = 16;
  574. + $keys{'key17'} = 17;
  575. + $keys{'key18'} = 18;
  576. + $keys{'key19'} = 19;
  577. + $keys{'key20'} = 20;
  578. + $keys{'key21'} = 21;
  579. + $keys{'key22'} = 22;
  580. + $keys{'key23'} = 23;
  581. + $keys{'key24'} = 24;
  582. + $keys{'key25'} = 25;
  583. + $keys{'key26'} = 26;
  584. + $keys{'key27'} = 27;
  585. + $keys{'key28'} = 28;
  586. + $keys{'key29'} = 29;
  587. + $keys{'key30'} = 30;
  588. + $keys{'key31'} = 31;
  589. + $keys{'key32'} = 32;
  590. + $keys{'key33'} = 33;
  591. + $keys{'key34'} = 34;
  592. + $keys{'key35'} = 35;
  593. + $keys{'key36'} = 36;
  594. + $keys{'key37'} = 37;
  595. + $keys{'key38'} = 38;
  596. + $keys{'key39'} = 39;
  597. + $keys{'key40'} = 40;
  598. + $keys{'key41'} = 41;
  599. + $keys{'key42'} = 42;
  600. + $keys{'key43'} = 43;
  601. + $keys{'key44'} = 44;
  602. + $keys{'key45'} = 45;
  603. + $keys{'key46'} = 46;
  604. + $keys{'key47'} = 47;
  605. + $keys{'key48'} = 48;
  606. + $keys{'key49'} = 49;
  607. + $keys{'key50'} = 50;
  608. + $keys{'key51'} = 51;
  609. + $keys{'key52'} = 52;
  610. + $keys{'key53'} = 53;
  611. + $keys{'key54'} = 54;
  612. + $keys{'key55'} = 55;
  613. + $keys{'key56'} = 56;
  614. + $keys{'key57'} = 57;
  615. + $keys{'key58'} = 58;
  616. + $keys{'key59'} = 59;
  617. + $keys{'key60'} = 60;
  618. + $keys{'key61'} = 61;
  619. + $keys{'key62'} = 62;
  620. + $keys{'key63'} = 63;
  621. + $keys{'key64'} = 64;
  622. + $keys{'key65'} = 65;
  623. + $keys{'key66'} = 66;
  624. + $keys{'key67'} = 67;
  625. + $keys{'key68'} = 68;
  626. + $keys{'key69'} = 69;
  627. + $keys{'key70'} = 70;
  628. + $keys{'key71'} = 71;
  629. + $keys{'key72'} = 72;
  630. + $keys{'key73'} = 73;
  631. + $keys{'key74'} = 74;
  632. + $keys{'key75'} = 75;
  633. + $keys{'key76'} = 76;
  634. + $keys{'key77'} = 77;
  635. + $keys{'key78'} = 78;
  636. + $keys{'key79'} = 79;
  637. + $keys{'key80'} = 80;
  638. + $keys{'key81'} = 81;
  639. + $keys{'key82'} = 82;
  640. + $keys{'key83'} = 83;
  641. + $keys{'key84'} = 84;
  642. + $keys{'key85'} = 85;
  643. + $keys{'key86'} = 86;
  644. + $keys{'key87'} = 87;
  645. + $keys{'key88'} = 88;
  646. + $keys{'key89'} = 89;
  647. + $keys{'key90'} = 90;
  648. + $keys{'key91'} = 91;
  649. + $keys{'key92'} = 92;
  650. + $keys{'key93'} = 93;
  651. + $keys{'key94'} = 94;
  652. + $keys{'key95'} = 95;
  653. + $keys{'key96'} = 96;
  654. + $keys{'key97'} = 97;
  655. + $keys{'key98'} = 98;
  656. + $keys{'key99'} = 99;
  657. + $keys{'key9998'} = 9998;
  658. + $keys{'key9999'} = 9999;
  659. + print "Done\n";
  660. + dbmclose (%keys);
  661. + die "cant read dbmtest" unless dbmopen(%rkeys, "dbmtest", undef);
  662. + $i = 0;
  663. + print "Reading...\n";
  664. + while (($key, $val) = each %rkeys)
  665. + {
  666. +   if ($keys{$key} != $val)
  667. +   {
  668. +      print 'Incorrect val ', $key, ' = ', $val, ' expecting ', $keys{$key}, "\n";
  669. +      $i = $i + 1;
  670. +   }
  671. + }
  672. + print "Done\n";
  673. + dbmclose (%keys);
  674. + print $i, "Error(s)\n";
  675.  
  676. Index: doarg.c
  677. *** doarg.c.old    Mon Jun  8 17:46:34 1992
  678. --- doarg.c    Mon Jun  8 17:46:36 1992
  679. ***************
  680. *** 1,4 ****
  681. ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.5 $$Date: 91/11/11 16:31:58 $
  682.    *
  683.    *    Copyright (c) 1991, Larry Wall
  684.    *
  685. --- 1,4 ----
  686. ! /* $RCSfile: doarg.c,v $$Revision: 4.0.1.6 $$Date: 92/06/08 12:34:30 $
  687.    *
  688.    *    Copyright (c) 1991, Larry Wall
  689.    *
  690. ***************
  691. *** 6,11 ****
  692. --- 6,21 ----
  693.    *    License or the Artistic License, as specified in the README file.
  694.    *
  695.    * $Log:    doarg.c,v $
  696. +  * Revision 4.0.1.6  92/06/08  12:34:30  lwall
  697. +  * patch20: removed implicit int declarations on funcions
  698. +  * patch20: pattern modifiers i and o didn't interact right
  699. +  * patch20: join() now pre-extends target string to avoid excessive copying
  700. +  * patch20: fixed confusion between a *var's real name and its effective name
  701. +  * patch20: subroutines didn't localize $`, $&, $', $1 et al correctly
  702. +  * patch20: usersub routines didn't reclaim temp values soon enough
  703. +  * patch20: ($<,$>) = ... didn't work on some architectures
  704. +  * patch20: added Atari ST portability
  705. +  * 
  706.    * Revision 4.0.1.5  91/11/11  16:31:58  lwall
  707.    * patch19: added little-endian pack/unpack options
  708.    * 
  709. ***************
  710. *** 53,58 ****
  711. --- 63,70 ----
  712.    #pragma function(memcmp)
  713.   #endif /* BUGGY_MSC */
  714.   
  715. + static void doencodes();
  716.   int
  717.   do_subst(str,arg,sp)
  718.   STR *str;
  719. ***************
  720. *** 90,96 ****
  721.       spat->spat_regexp = regcomp(m,m+dstr->str_cur,
  722.           spat->spat_flags & SPAT_FOLD);
  723.       if (spat->spat_flags & SPAT_KEEP) {
  724. !         scanconst(spat, m, dstr->str_cur);
  725.           arg_free(spat->spat_runtime);    /* it won't change, so */
  726.           spat->spat_runtime = Nullarg;    /* no point compiling again */
  727.           hoistmust(spat);
  728. --- 102,109 ----
  729.       spat->spat_regexp = regcomp(m,m+dstr->str_cur,
  730.           spat->spat_flags & SPAT_FOLD);
  731.       if (spat->spat_flags & SPAT_KEEP) {
  732. !         if (!(spat->spat_flags & SPAT_FOLD))
  733. !         scanconst(spat, m, dstr->str_cur);
  734.           arg_free(spat->spat_runtime);    /* it won't change, so */
  735.           spat->spat_runtime = Nullarg;    /* no point compiling again */
  736.           hoistmust(spat);
  737. ***************
  738. *** 178,189 ****
  739.               s = orig;
  740.               if (m - s > strend - d) {    /* faster to shorten from end */
  741.               if (clen) {
  742. !                 (void)bcopy(c, m, clen);
  743.                   m += clen;
  744.               }
  745.               i = strend - d;
  746.               if (i > 0) {
  747. !                 (void)bcopy(d, m, i);
  748.                   m += i;
  749.               }
  750.               *m = '\0';
  751. --- 191,202 ----
  752.               s = orig;
  753.               if (m - s > strend - d) {    /* faster to shorten from end */
  754.               if (clen) {
  755. !                 Copy(c, m, clen, char);
  756.                   m += clen;
  757.               }
  758.               i = strend - d;
  759.               if (i > 0) {
  760. !                 Move(d, m, i, char);
  761.                   m += i;
  762.               }
  763.               *m = '\0';
  764. ***************
  765. *** 202,208 ****
  766.               while (i--)
  767.                   *--d = *--s;
  768.               if (clen)
  769. !                 (void)bcopy(c, m, clen);
  770.               STABSET(str);
  771.               str_numset(arg->arg_ptr.arg_str, 1.0);
  772.               stack->ary_array[++sp] = arg->arg_ptr.arg_str;
  773. --- 215,221 ----
  774.               while (i--)
  775.                   *--d = *--s;
  776.               if (clen)
  777. !                 Copy(c, m, clen, char);
  778.               STABSET(str);
  779.               str_numset(arg->arg_ptr.arg_str, 1.0);
  780.               stack->ary_array[++sp] = arg->arg_ptr.arg_str;
  781. ***************
  782. *** 211,217 ****
  783.               else if (clen) {
  784.               d -= clen;
  785.               str_chop(str,d);
  786. !             (void)bcopy(c,d,clen);
  787.               STABSET(str);
  788.               str_numset(arg->arg_ptr.arg_str, 1.0);
  789.               stack->ary_array[++sp] = arg->arg_ptr.arg_str;
  790. --- 224,230 ----
  791.               else if (clen) {
  792.               d -= clen;
  793.               str_chop(str,d);
  794. !             Copy(c,d,clen,char);
  795.               STABSET(str);
  796.               str_numset(arg->arg_ptr.arg_str, 1.0);
  797.               stack->ary_array[++sp] = arg->arg_ptr.arg_str;
  798. ***************
  799. *** 233,243 ****
  800.               /*SUPPRESS 560*/
  801.               if (i = m - s) {
  802.               if (s != d)
  803. !                 (void)bcopy(s,d,i);
  804.               d += i;
  805.               }
  806.               if (clen) {
  807. !             (void)bcopy(c,d,clen);
  808.               d += clen;
  809.               }
  810.               s = spat->spat_regexp->endp[0];
  811. --- 246,256 ----
  812.               /*SUPPRESS 560*/
  813.               if (i = m - s) {
  814.               if (s != d)
  815. !                 Move(s,d,i,char);
  816.               d += i;
  817.               }
  818.               if (clen) {
  819. !             Copy(c,d,clen,char);
  820.               d += clen;
  821.               }
  822.               s = spat->spat_regexp->endp[0];
  823. ***************
  824. *** 246,252 ****
  825.           if (s != d) {
  826.               i = strend - s;
  827.               str->str_cur = d - str->str_ptr + i;
  828. !             (void)bcopy(s,d,i+1);        /* include the Null */
  829.           }
  830.           STABSET(str);
  831.           str_numset(arg->arg_ptr.arg_str, (double)iters);
  832. --- 259,265 ----
  833.           if (s != d) {
  834.               i = strend - s;
  835.               str->str_cur = d - str->str_ptr + i;
  836. !             Move(s,d,i+1,char);        /* include the Null */
  837.           }
  838.           STABSET(str);
  839.           str_numset(arg->arg_ptr.arg_str, (double)iters);
  840. ***************
  841. *** 385,403 ****
  842.   int *arglast;
  843.   {
  844.       register STR **st = stack->ary_array;
  845. !     register int sp = arglast[1];
  846.       register int items = arglast[2] - sp;
  847.       register char *delim = str_get(st[sp]);
  848.       int delimlen = st[sp]->str_cur;
  849.   
  850. !     st += ++sp;
  851.       if (items-- > 0)
  852.       str_sset(str, *st++);
  853.       else
  854.       str_set(str,"");
  855. !     if (delimlen) {
  856.       for (; items > 0; items--,st++) {
  857. !         str_ncat(str,delim,delimlen);
  858.           str_scat(str,*st);
  859.       }
  860.       }
  861. --- 398,432 ----
  862.   int *arglast;
  863.   {
  864.       register STR **st = stack->ary_array;
  865. !     int sp = arglast[1];
  866.       register int items = arglast[2] - sp;
  867.       register char *delim = str_get(st[sp]);
  868. +     register STRLEN len;
  869.       int delimlen = st[sp]->str_cur;
  870.   
  871. !     st += sp + 1;
  872. !     len = delimlen * (items - 1);
  873. !     if (str->str_len < len + items) {    /* current length is way too short */
  874. !     while (items-- > 0) {
  875. !         if (*st)
  876. !         len += (*st)->str_cur;
  877. !         st++;
  878. !     }
  879. !     STR_GROW(str, len + 1);        /* so try to pre-extend */
  880. !     items = arglast[2] - sp;
  881. !     st -= items;
  882. !     }
  883.       if (items-- > 0)
  884.       str_sset(str, *st++);
  885.       else
  886.       str_set(str,"");
  887. !     len = delimlen;
  888. !     if (len) {
  889.       for (; items > 0; items--,st++) {
  890. !         str_ncat(str,delim,len);
  891.           str_scat(str,*st);
  892.       }
  893.       }
  894. ***************
  895. *** 780,785 ****
  896. --- 809,815 ----
  897.   }
  898.   #undef NEXTFROM
  899.   
  900. + static void
  901.   doencodes(str, s, len)
  902.   register STR *str;
  903.   register char *s;
  904. ***************
  905. *** 938,944 ****
  906.             && xlen == sizeof(STBP)) {
  907.               STR *tmpstr = Str_new(24,0);
  908.   
  909. !             stab_fullname(tmpstr, ((STAB*)arg)); /* a stab value! */
  910.               sprintf(tokenbuf,"*%s",tmpstr->str_ptr);
  911.                       /* reformat to non-binary */
  912.               xs = tokenbuf;
  913. --- 968,974 ----
  914.             && xlen == sizeof(STBP)) {
  915.               STR *tmpstr = Str_new(24,0);
  916.   
  917. !             stab_efullname(tmpstr, ((STAB*)arg)); /* a stab value! */
  918.               sprintf(tokenbuf,"*%s",tmpstr->str_ptr);
  919.                       /* reformat to non-binary */
  920.               xs = tokenbuf;
  921. ***************
  922. *** 1053,1058 ****
  923. --- 1083,1089 ----
  924.       register int sp = arglast[1];
  925.       register int items = arglast[2] - sp;
  926.       register SUBR *sub;
  927. +     SPAT * VOLATILE oldspat = curspat;
  928.       STR *str;
  929.       STAB *stab;
  930.       int oldsave = savestack->ary_fill;
  931. ***************
  932. *** 1075,1087 ****
  933.       if (!(sub = stab_sub(stab))) {
  934.       STR *tmpstr = arg[0].arg_ptr.arg_str;
  935.   
  936. !     stab_fullname(tmpstr, stab);
  937.       fatal("Undefined subroutine \"%s\" called",tmpstr->str_ptr);
  938.       }
  939.       if (arg->arg_type == O_DBSUBR && !sub->usersub) {
  940.       str = stab_val(DBsub);
  941.       saveitem(str);
  942. !     stab_fullname(str,stab);
  943.       sub = stab_sub(DBsub);
  944.       if (!sub)
  945.           fatal("No DBsub routine");
  946. --- 1106,1118 ----
  947.       if (!(sub = stab_sub(stab))) {
  948.       STR *tmpstr = arg[0].arg_ptr.arg_str;
  949.   
  950. !     stab_efullname(tmpstr, stab);
  951.       fatal("Undefined subroutine \"%s\" called",tmpstr->str_ptr);
  952.       }
  953.       if (arg->arg_type == O_DBSUBR && !sub->usersub) {
  954.       str = stab_val(DBsub);
  955.       saveitem(str);
  956. !     stab_efullname(str,stab);
  957.       sub = stab_sub(DBsub);
  958.       if (!sub)
  959.           fatal("No DBsub routine");
  960. ***************
  961. *** 1098,1103 ****
  962. --- 1129,1135 ----
  963.       csv->wantarray = gimme;
  964.       csv->hasargs = hasargs;
  965.       curcsv = csv;
  966. +     tmps_base = tmps_max;
  967.       if (sub->usersub) {
  968.       csv->hasargs = 0;
  969.       csv->savearray = Null(ARRAY*);;
  970. ***************
  971. *** 1105,1132 ****
  972.       st[sp] = arg->arg_ptr.arg_str;
  973.       if (!hasargs)
  974.           items = 0;
  975. !     return (*sub->usersub)(sub->userindex,sp,items);
  976.       }
  977. !     if (hasargs) {
  978. !     csv->savearray = stab_xarray(defstab);
  979. !     csv->argarray = afake(defstab, items, &st[sp+1]);
  980. !     stab_xarray(defstab) = csv->argarray;
  981.       }
  982. -     sub->depth++;
  983. -     if (sub->depth >= 2) {    /* save temporaries on recursion? */
  984. -     if (sub->depth == 100 && dowarn)
  985. -         warn("Deep recursion on subroutine \"%s\"",stab_name(stab));
  986. -     savelist(sub->tosave->ary_array,sub->tosave->ary_fill);
  987. -     }
  988. -     tmps_base = tmps_max;
  989. -     sp = cmd_exec(sub->cmd,gimme, --sp);    /* so do it already */
  990. -     st = stack->ary_array;
  991.   
  992.       tmps_base = oldtmps_base;
  993.       for (items = arglast[0] + 1; items <= sp; items++)
  994.       st[items] = str_mortal(st[items]);
  995.           /* in case restore wipes old str */
  996.       restorelist(oldsave);
  997.       return sp;
  998.   }
  999.   
  1000. --- 1137,1166 ----
  1001.       st[sp] = arg->arg_ptr.arg_str;
  1002.       if (!hasargs)
  1003.           items = 0;
  1004. !     sp = (*sub->usersub)(sub->userindex,sp,items);
  1005.       }
  1006. !     else {
  1007. !     if (hasargs) {
  1008. !         csv->savearray = stab_xarray(defstab);
  1009. !         csv->argarray = afake(defstab, items, &st[sp+1]);
  1010. !         stab_xarray(defstab) = csv->argarray;
  1011. !     }
  1012. !     sub->depth++;
  1013. !     if (sub->depth >= 2) {    /* save temporaries on recursion? */
  1014. !         if (sub->depth == 100 && dowarn)
  1015. !         warn("Deep recursion on subroutine \"%s\"",stab_ename(stab));
  1016. !         savelist(sub->tosave->ary_array,sub->tosave->ary_fill);
  1017. !     }
  1018. !     sp = cmd_exec(sub->cmd,gimme, --sp);    /* so do it already */
  1019.       }
  1020.   
  1021. +     st = stack->ary_array;
  1022.       tmps_base = oldtmps_base;
  1023.       for (items = arglast[0] + 1; items <= sp; items++)
  1024.       st[items] = str_mortal(st[items]);
  1025.           /* in case restore wipes old str */
  1026.       restorelist(oldsave);
  1027. +     curspat = oldspat;
  1028.       return sp;
  1029.   }
  1030.   
  1031. ***************
  1032. *** 1264,1285 ****
  1033.           STABSET(str);
  1034.       }
  1035.       }
  1036. !     if (delaymagic > 1) {
  1037. !     if (delaymagic & DM_REUID) {
  1038.   #ifdef HAS_SETREUID
  1039. !         setreuid(uid,euid);
  1040. ! #else
  1041. !         if (uid != euid || setuid(uid) < 0)
  1042. !         fatal("No setreuid available");
  1043. ! #endif
  1044.       }
  1045. !     if (delaymagic & DM_REGID) {
  1046.   #ifdef HAS_SETREGID
  1047. !         setregid(gid,egid);
  1048. ! #else
  1049. !         if (gid != egid || setgid(gid) < 0)
  1050. !         fatal("No setregid available");
  1051. ! #endif
  1052.       }
  1053.       }
  1054.       delaymagic = 0;
  1055. --- 1298,1353 ----
  1056.           STABSET(str);
  1057.       }
  1058.       }
  1059. !     if (delaymagic & ~DM_DELAY) {
  1060. !     if (delaymagic & DM_UID) {
  1061.   #ifdef HAS_SETREUID
  1062. !         (void)setreuid(uid,euid);
  1063. ! #else /* not HAS_SETREUID */
  1064. ! #ifdef HAS_SETRUID
  1065. !         if ((delaymagic & DM_UID) == DM_RUID) {
  1066. !         (void)setruid(uid);
  1067. !         delaymagic =~ DM_RUID;
  1068. !         }
  1069. ! #endif /* HAS_SETRUID */
  1070. ! #ifdef HAS_SETEUID
  1071. !         if ((delaymagic & DM_UID) == DM_EUID) {
  1072. !         (void)seteuid(uid);
  1073. !         delaymagic =~ DM_EUID;
  1074. !         }
  1075. ! #endif /* HAS_SETEUID */
  1076. !         if (delaymagic & DM_UID) {
  1077. !         if (uid != euid)
  1078. !             fatal("No setreuid available");
  1079. !         (void)setuid(uid);
  1080. !         }
  1081. ! #endif /* not HAS_SETREUID */
  1082. !         uid = (int)getuid();
  1083. !         euid = (int)geteuid();
  1084.       }
  1085. !     if (delaymagic & DM_GID) {
  1086.   #ifdef HAS_SETREGID
  1087. !         (void)setregid(gid,egid);
  1088. ! #else /* not HAS_SETREGID */
  1089. ! #ifdef HAS_SETRGID
  1090. !         if ((delaymagic & DM_GID) == DM_RGID) {
  1091. !         (void)setrgid(gid);
  1092. !         delaymagic =~ DM_RGID;
  1093. !         }
  1094. ! #endif /* HAS_SETRGID */
  1095. ! #ifdef HAS_SETEGID
  1096. !         if ((delaymagic & DM_GID) == DM_EGID) {
  1097. !         (void)setegid(gid);
  1098. !         delaymagic =~ DM_EGID;
  1099. !         }
  1100. ! #endif /* HAS_SETEGID */
  1101. !         if (delaymagic & DM_GID) {
  1102. !         if (gid != egid)
  1103. !             fatal("No setregid available");
  1104. !         (void)setgid(gid);
  1105. !         }
  1106. ! #endif /* not HAS_SETREGID */
  1107. !         gid = (int)getgid();
  1108. !         egid = (int)getegid();
  1109.       }
  1110.       }
  1111.       delaymagic = 0;
  1112. ***************
  1113. *** 1498,1504 ****
  1114.       else {
  1115.       if (len > str->str_cur) {
  1116.           STR_GROW(str,len);
  1117. !         (void)bzero(str->str_ptr + str->str_cur, len - str->str_cur);
  1118.           str->str_cur = len;
  1119.       }
  1120.       s = (unsigned char*)str_get(str);
  1121. --- 1566,1572 ----
  1122.       else {
  1123.       if (len > str->str_cur) {
  1124.           STR_GROW(str,len);
  1125. !         (void)memzero(str->str_ptr + str->str_cur, len - str->str_cur);
  1126.           str->str_cur = len;
  1127.       }
  1128.       s = (unsigned char*)str_get(str);
  1129. ***************
  1130. *** 1571,1576 ****
  1131. --- 1639,1645 ----
  1132.       }
  1133.   }
  1134.   
  1135. + void
  1136.   do_chop(astr,str)
  1137.   register STR *astr;
  1138.   register STR *str;
  1139. ***************
  1140. *** 1610,1615 ****
  1141. --- 1679,1685 ----
  1142.       str_nset(astr,"",0);
  1143.   }
  1144.   
  1145. + void
  1146.   do_vop(optype,str,left,right)
  1147.   STR *str;
  1148.   STR *left;
  1149. ***************
  1150. *** 1627,1633 ****
  1151.       str->str_cur = len;
  1152.       else if (str->str_cur < len) {
  1153.       STR_GROW(str,len);
  1154. !     (void)bzero(str->str_ptr + str->str_cur, len - str->str_cur);
  1155.       str->str_cur = len;
  1156.       }
  1157.       str->str_pok = 1;
  1158. --- 1697,1703 ----
  1159.       str->str_cur = len;
  1160.       else if (str->str_cur < len) {
  1161.       STR_GROW(str,len);
  1162. !     (void)memzero(str->str_ptr + str->str_cur, len - str->str_cur);
  1163.       str->str_cur = len;
  1164.       }
  1165.       str->str_pok = 1;
  1166. ***************
  1167. *** 1666,1672 ****
  1168. --- 1736,1746 ----
  1169.       register STR **st = stack->ary_array;
  1170.       register int sp = arglast[1];
  1171.       register int items = arglast[2] - sp;
  1172. + #ifdef atarist
  1173. +     unsigned long arg[14]; /* yes, we really need that many ! */
  1174. + #else
  1175.       unsigned long arg[8];
  1176. + #endif
  1177.       register int i = 0;
  1178.       int retval = -1;
  1179.   
  1180. ***************
  1181. *** 1723,1728 ****
  1182. --- 1797,1828 ----
  1183.       retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1184.         arg[7]);
  1185.       break;
  1186. + #ifdef atarist
  1187. +     case 9:
  1188. +     retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1189. +       arg[7], arg[8]);
  1190. +     break;
  1191. +     case 10:
  1192. +     retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1193. +       arg[7], arg[8], arg[9]);
  1194. +     break;
  1195. +     case 11:
  1196. +     retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1197. +       arg[7], arg[8], arg[9], arg[10]);
  1198. +     break;
  1199. +     case 12:
  1200. +     retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1201. +       arg[7], arg[8], arg[9], arg[10], arg[11]);
  1202. +     break;
  1203. +     case 13:
  1204. +     retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1205. +       arg[7], arg[8], arg[9], arg[10], arg[11], arg[12]);
  1206. +     break;
  1207. +     case 14:
  1208. +     retval = syscall(arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],
  1209. +       arg[7], arg[8], arg[9], arg[10], arg[11], arg[12], arg[13]);
  1210. +     break;
  1211. + #endif /* atarist */
  1212.       }
  1213.       return retval;
  1214.   #else
  1215.  
  1216. Index: dump.c
  1217. *** dump.c.old    Mon Jun  8 17:47:08 1992
  1218. --- dump.c    Mon Jun  8 17:47:09 1992
  1219. ***************
  1220. *** 1,4 ****
  1221. ! /* $RCSfile: dump.c,v $$Revision: 4.0.1.1 $$Date: 91/06/07 10:58:44 $
  1222.    *
  1223.    *    Copyright (c) 1991, Larry Wall
  1224.    *
  1225. --- 1,4 ----
  1226. ! /* $RCSfile: dump.c,v $$Revision: 4.0.1.2 $$Date: 92/06/08 13:14:22 $
  1227.    *
  1228.    *    Copyright (c) 1991, Larry Wall
  1229.    *
  1230. ***************
  1231. *** 6,11 ****
  1232. --- 6,15 ----
  1233.    *    License or the Artistic License, as specified in the README file.
  1234.    *
  1235.    * $Log:    dump.c,v $
  1236. +  * Revision 4.0.1.2  92/06/08  13:14:22  lwall
  1237. +  * patch20: removed implicit int declarations on funcions
  1238. +  * patch20: fixed confusion between a *var's real name and its effective name
  1239. +  * 
  1240.    * Revision 4.0.1.1  91/06/07  10:58:44  lwall
  1241.    * patch4: new copyright notice
  1242.    * 
  1243. ***************
  1244. *** 20,25 ****
  1245. --- 24,32 ----
  1246.   #ifdef DEBUGGING
  1247.   static int dumplvl = 0;
  1248.   
  1249. + static void dump();
  1250. + void
  1251.   dump_all()
  1252.   {
  1253.       register int i;
  1254. ***************
  1255. *** 40,45 ****
  1256. --- 47,53 ----
  1257.       }
  1258.   }
  1259.   
  1260. + void
  1261.   dump_cmd(cmd,alt)
  1262.   register CMD *cmd;
  1263.   register CMD *alt;
  1264. ***************
  1265. *** 160,165 ****
  1266. --- 168,174 ----
  1267.       }
  1268.   }
  1269.   
  1270. + void
  1271.   dump_arg(arg)
  1272.   register ARG *arg;
  1273.   {
  1274. ***************
  1275. *** 231,236 ****
  1276. --- 240,246 ----
  1277.       dump("}\n");
  1278.   }
  1279.   
  1280. + void
  1281.   dump_flags(b,flags)
  1282.   char *b;
  1283.   unsigned int flags;
  1284. ***************
  1285. *** 256,261 ****
  1286. --- 266,272 ----
  1287.       b[strlen(b)-1] = '\0';
  1288.   }
  1289.   
  1290. + void
  1291.   dump_stab(stab)
  1292.   register STAB *stab;
  1293.   {
  1294. ***************
  1295. *** 269,279 ****
  1296.       dumplvl++;
  1297.       fprintf(stderr,"{\n");
  1298.       stab_fullname(str,stab);
  1299. !     dump("STAB_NAME = %s\n", str->str_ptr);
  1300.       dumplvl--;
  1301.       dump("}\n");
  1302.   }
  1303.   
  1304.   dump_spat(spat)
  1305.   register SPAT *spat;
  1306.   {
  1307. --- 280,296 ----
  1308.       dumplvl++;
  1309.       fprintf(stderr,"{\n");
  1310.       stab_fullname(str,stab);
  1311. !     dump("STAB_NAME = %s", str->str_ptr);
  1312. !     if (stab != stab_estab(stab)) {
  1313. !     stab_efullname(str,stab_estab(stab));
  1314. !     dump("-> %s", str->str_ptr);
  1315. !     }
  1316. !     dump("\n");
  1317.       dumplvl--;
  1318.       dump("}\n");
  1319.   }
  1320.   
  1321. + void
  1322.   dump_spat(spat)
  1323.   register SPAT *spat;
  1324.   {
  1325. ***************
  1326. *** 307,313 ****
  1327.   }
  1328.   
  1329.   /* VARARGS1 */
  1330. ! dump(arg1,arg2,arg3,arg4,arg5)
  1331.   char *arg1;
  1332.   long arg2, arg3, arg4, arg5;
  1333.   {
  1334. --- 324,330 ----
  1335.   }
  1336.   
  1337.   /* VARARGS1 */
  1338. ! static void dump(arg1,arg2,arg3,arg4,arg5)
  1339.   char *arg1;
  1340.   long arg2, arg3, arg4, arg5;
  1341.   {
  1342.  
  1343. Index: eval.c
  1344. *** eval.c.old    Mon Jun  8 17:47:17 1992
  1345. --- eval.c    Mon Jun  8 17:47:19 1992
  1346. ***************
  1347. *** 1,4 ****
  1348. ! /* $RCSfile: eval.c,v $$Revision: 4.0.1.3 $$Date: 91/11/05 17:15:21 $
  1349.    *
  1350.    *    Copyright (c) 1991, Larry Wall
  1351.    *
  1352. --- 1,4 ----
  1353. ! /* $RCSfile: eval.c,v $$Revision: 4.0.1.4 $$Date: 92/06/08 13:20:20 $
  1354.    *
  1355.    *    Copyright (c) 1991, Larry Wall
  1356.    *
  1357. ***************
  1358. *** 6,11 ****
  1359. --- 6,21 ----
  1360.    *    License or the Artistic License, as specified in the README file.
  1361.    *
  1362.    * $Log:    eval.c,v $
  1363. +  * Revision 4.0.1.4  92/06/08  13:20:20  lwall
  1364. +  * patch20: added explicit time_t support
  1365. +  * patch20: fixed confusion between a *var's real name and its effective name
  1366. +  * patch20: added Atari ST portability
  1367. +  * patch20: new warning for use of x with non-numeric right operand
  1368. +  * patch20: modulus with highest bit in left operand set didn't always work
  1369. +  * patch20: dbmclose(%array) didn't work
  1370. +  * patch20: added ... as variant on ..
  1371. +  * patch20: O_PIPE conflicted with Atari
  1372. +  * 
  1373.    * Revision 4.0.1.3  91/11/05  17:15:21  lwall
  1374.    * patch11: prepared for ctype implementations that don't define isascii()
  1375.    * patch11: various portability fixes
  1376. ***************
  1377. *** 44,49 ****
  1378. --- 54,64 ----
  1379.   #ifdef I_FCNTL
  1380.   #include <fcntl.h>
  1381.   #endif
  1382. + #ifdef MSDOS
  1383. + /* I_FCNTL *MUST* not be defined for MS-DOS and OS/2
  1384. +    but fcntl.h is required for O_BINARY */
  1385. + #include <fcntl.h>
  1386. + #endif
  1387.   #ifdef I_SYS_FILE
  1388.   #include <sys/file.h>
  1389.   #endif
  1390. ***************
  1391. *** 89,96 ****
  1392.       int argtype;
  1393.       union argptr argptr;
  1394.       int arglast[8];    /* highest sp for arg--valid only for non-O_LIST args */
  1395. !     unsigned long tmplong;
  1396. !     long when;
  1397.       FILE *fp;
  1398.       STR *tmpstr;
  1399.       FCMD *form;
  1400. --- 104,113 ----
  1401.       int argtype;
  1402.       union argptr argptr;
  1403.       int arglast[8];    /* highest sp for arg--valid only for non-O_LIST args */
  1404. !     unsigned long tmpulong;
  1405. !     long tmplong;
  1406. !     time_t when;
  1407. !     STRLEN tmplen;
  1408.       FILE *fp;
  1409.       STR *tmpstr;
  1410.       FCMD *form;
  1411. ***************
  1412. *** 204,210 ****
  1413.           stab_io(stab) = stio_new();
  1414.   #ifdef DEBUGGING
  1415.           if (debug & 8) {
  1416. !         (void)sprintf(buf,"STAR *%s",stab_name(argptr.arg_stab));
  1417.           tmps = buf;
  1418.           }
  1419.   #endif
  1420. --- 221,228 ----
  1421.           stab_io(stab) = stio_new();
  1422.   #ifdef DEBUGGING
  1423.           if (debug & 8) {
  1424. !         (void)sprintf(buf,"STAR *%s -> *%s",
  1425. !             stab_name(argptr.arg_stab), stab_ename(argptr.arg_stab));
  1426.           tmps = buf;
  1427.           }
  1428.   #endif
  1429. ***************
  1430. *** 213,219 ****
  1431.           str = st[++sp] = (STR*)argptr.arg_stab;
  1432.   #ifdef DEBUGGING
  1433.           if (debug & 8) {
  1434. !         (void)sprintf(buf,"LSTAR *%s",stab_name(argptr.arg_stab));
  1435.           tmps = buf;
  1436.           }
  1437.   #endif
  1438. --- 231,238 ----
  1439.           str = st[++sp] = (STR*)argptr.arg_stab;
  1440.   #ifdef DEBUGGING
  1441.           if (debug & 8) {
  1442. !         (void)sprintf(buf,"LSTAR *%s -> *%s",
  1443. !         stab_name(argptr.arg_stab), stab_ename(argptr.arg_stab));
  1444.           tmps = buf;
  1445.           }
  1446.   #endif
  1447. ***************
  1448. *** 390,396 ****
  1449.           old_rschar = rschar;
  1450.           old_rslen = rslen;
  1451.           rslen = 1;
  1452. ! #ifdef MSDOS
  1453.           rschar = 0;
  1454.   #else
  1455.   #ifdef CSH
  1456. --- 409,415 ----
  1457.           old_rschar = rschar;
  1458.           old_rslen = rslen;
  1459.           rslen = 1;
  1460. ! #ifdef DOSISH
  1461.           rschar = 0;
  1462.   #else
  1463.   #ifdef CSH
  1464. ***************
  1465. *** 433,439 ****
  1466.               (void) interp(str,stab_val(last_in_stab),sp);
  1467.               st = stack->ary_array;
  1468.               tmpstr = Str_new(55,0);
  1469. ! #ifdef MSDOS
  1470.               str_set(tmpstr, "perlglob ");
  1471.               str_scat(tmpstr,str);
  1472.               str_cat(tmpstr," |");
  1473. --- 452,458 ----
  1474.               (void) interp(str,stab_val(last_in_stab),sp);
  1475.               st = stack->ary_array;
  1476.               tmpstr = Str_new(55,0);
  1477. ! #ifdef DOSISH
  1478.               str_set(tmpstr, "perlglob ");
  1479.               str_scat(tmpstr,str);
  1480.               str_cat(tmpstr," |");
  1481. ***************
  1482. *** 458,466 ****
  1483.           }
  1484.           }
  1485.           if (!fp && dowarn)
  1486. !         warn("Read on closed filehandle <%s>",stab_name(last_in_stab));
  1487. !         when = str->str_len;    /* remember if already alloced */
  1488. !         if (!when)
  1489.           Str_Grow(str,80);    /* try short-buffering it */
  1490.         keepgoing:
  1491.           if (!fp)
  1492. --- 477,485 ----
  1493.           }
  1494.           }
  1495.           if (!fp && dowarn)
  1496. !         warn("Read on closed filehandle <%s>",stab_ename(last_in_stab));
  1497. !         tmplen = str->str_len;    /* remember if already alloced */
  1498. !         if (!tmplen)
  1499.           Str_Grow(str,80);    /* try short-buffering it */
  1500.         keepgoing:
  1501.           if (!fp)
  1502. ***************
  1503. *** 520,526 ****
  1504.               str = Str_new(58,80);
  1505.               goto keepgoing;
  1506.           }
  1507. !         else if (!when && str->str_len - str->str_cur > 80) {
  1508.               /* try to reclaim a bit of scalar space on 1st alloc */
  1509.               if (str->str_cur < 60)
  1510.               str->str_len = 80;
  1511. --- 539,545 ----
  1512.               str = Str_new(58,80);
  1513.               goto keepgoing;
  1514.           }
  1515. !         else if (!tmplen && str->str_len - str->str_cur > 80) {
  1516.               /* try to reclaim a bit of scalar space on 1st alloc */
  1517.               if (str->str_cur < 60)
  1518.               str->str_len = 80;
  1519. ***************
  1520. *** 584,591 ****
  1521.           sp = do_repeatary(arglast);
  1522.           goto array_return;
  1523.       }
  1524. !     STR_SSET(str,st[arglast[1] - arglast[0]]);
  1525. !     anum = (int)str_gnum(st[arglast[2] - arglast[0]]);
  1526.       if (anum >= 1) {
  1527.           tmpstr = Str_new(50, 0);
  1528.           tmps = str_get(str);
  1529. --- 603,610 ----
  1530.           sp = do_repeatary(arglast);
  1531.           goto array_return;
  1532.       }
  1533. !     STR_SSET(str,st[1]);
  1534. !     anum = (int)str_gnum(st[2]);
  1535.       if (anum >= 1) {
  1536.           tmpstr = Str_new(50, 0);
  1537.           tmps = str_get(str);
  1538. ***************
  1539. *** 598,605 ****
  1540.           str->str_nok = 0;
  1541.           str_free(tmpstr);
  1542.       }
  1543. !     else
  1544.           str_sset(str,&str_no);
  1545.       STABSET(str);
  1546.       break;
  1547.       case O_MATCH:
  1548. --- 617,627 ----
  1549.           str->str_nok = 0;
  1550.           str_free(tmpstr);
  1551.       }
  1552. !     else {
  1553. !         if (dowarn && st[2]->str_pok && !looks_like_number(st[2]))
  1554. !         warn("Right operand of x is not numeric");
  1555.           str_sset(str,&str_no);
  1556. +     }
  1557.       STABSET(str);
  1558.       break;
  1559.       case O_MATCH:
  1560. ***************
  1561. *** 724,738 ****
  1562.   #endif
  1563.       goto donumset;
  1564.       case O_MODULO:
  1565. !     tmplong = (long) str_gnum(st[2]);
  1566. !         if (tmplong == 0L)
  1567.               fatal("Illegal modulus zero");
  1568. -     when = (long)str_gnum(st[1]);
  1569.   #ifndef lint
  1570. !     if (when >= 0)
  1571. !         value = (double)(when % tmplong);
  1572. !     else
  1573. !         value = (double)(tmplong - ((-when - 1) % tmplong)) - 1;
  1574.   #endif
  1575.       goto donumset;
  1576.       case O_ADD:
  1577. --- 746,762 ----
  1578.   #endif
  1579.       goto donumset;
  1580.       case O_MODULO:
  1581. !     tmpulong = (unsigned long) str_gnum(st[2]);
  1582. !         if (tmpulong == 0L)
  1583.               fatal("Illegal modulus zero");
  1584.   #ifndef lint
  1585. !     value = str_gnum(st[1]);
  1586. !     if (value >= 0.0)
  1587. !         value = (double)(((unsigned long)value) % tmpulong);
  1588. !     else {
  1589. !         tmplong = (long)value;
  1590. !         value = (double)(tmpulong - ((-tmplong - 1) % tmpulong)) - 1;
  1591. !     }
  1592.   #endif
  1593.       goto donumset;
  1594.       case O_ADD:
  1595. ***************
  1596. *** 916,922 ****
  1597.       }
  1598.       break;
  1599.       case O_SELECT:
  1600. !     stab_fullname(str,defoutstab);
  1601.       if (maxarg > 0) {
  1602.           if ((arg[1].arg_type & A_MASK) == A_WORD)
  1603.           defoutstab = arg[1].arg_ptr.arg_stab;
  1604. --- 940,946 ----
  1605.       }
  1606.       break;
  1607.       case O_SELECT:
  1608. !     stab_efullname(str,defoutstab);
  1609.       if (maxarg > 0) {
  1610.           if ((arg[1].arg_type & A_MASK) == A_WORD)
  1611.           defoutstab = arg[1].arg_ptr.arg_stab;
  1612. ***************
  1613. *** 989,995 ****
  1614.   #endif
  1615.       case O_DBMCLOSE:
  1616.   #ifdef SOME_DBM
  1617. !     if ((arg[1].arg_type & A_MASK) == A_WORD)
  1618.           stab = arg[1].arg_ptr.arg_stab;
  1619.       else
  1620.           stab = stabent(str_get(st[1]),TRUE);
  1621. --- 1013,1020 ----
  1622.   #endif
  1623.       case O_DBMCLOSE:
  1624.   #ifdef SOME_DBM
  1625. !     anum = arg[1].arg_type & A_MASK;
  1626. !     if (anum == A_WORD || anum == A_STAB)
  1627.           stab = arg[1].arg_ptr.arg_stab;
  1628.       else
  1629.           stab = stabent(str_get(st[1]),TRUE);
  1630. ***************
  1631. *** 1074,1080 ****
  1632.       tmps = str_get(st[2]);
  1633.       str = hdelete(stab_hash(tmpstab),tmps,st[2]->str_cur);
  1634.       if (tmpstab == envstab)
  1635. !         setenv(tmps,Nullch);
  1636.       if (!str)
  1637.           goto say_undef;
  1638.       break;
  1639. --- 1099,1105 ----
  1640.       tmps = str_get(st[2]);
  1641.       str = hdelete(stab_hash(tmpstab),tmps,st[2]->str_cur);
  1642.       if (tmpstab == envstab)
  1643. !         my_setenv(tmps,Nullch);
  1644.       if (!str)
  1645.           goto say_undef;
  1646.       break;
  1647. ***************
  1648. *** 1656,1662 ****
  1649.       if (maxarg < 1)
  1650.           (void)time(&when);
  1651.       else
  1652. !         when = (long)str_gnum(st[1]);
  1653.       sp = do_time(str,localtime(&when),
  1654.         gimme,arglast);
  1655.       goto array_return;
  1656. --- 1681,1687 ----
  1657.       if (maxarg < 1)
  1658.           (void)time(&when);
  1659.       else
  1660. !         when = (time_t)str_gnum(st[1]);
  1661.       sp = do_time(str,localtime(&when),
  1662.         gimme,arglast);
  1663.       goto array_return;
  1664. ***************
  1665. *** 1664,1670 ****
  1666.       if (maxarg < 1)
  1667.           (void)time(&when);
  1668.       else
  1669. !         when = (long)str_gnum(st[1]);
  1670.       sp = do_time(str,gmtime(&when),
  1671.         gimme,arglast);
  1672.       goto array_return;
  1673. --- 1689,1695 ----
  1674.       if (maxarg < 1)
  1675.           (void)time(&when);
  1676.       else
  1677. !         when = (time_t)str_gnum(st[1]);
  1678.       sp = do_time(str,gmtime(&when),
  1679.         gimme,arglast);
  1680.       goto array_return;
  1681. ***************
  1682. *** 1869,1885 ****
  1683.         last_in_stab && (int)str_gnum(st[1]) == stab_io(last_in_stab)->lines
  1684.         :
  1685.         str_true(st[1]) ) {
  1686. -         str_numset(str,0.0);
  1687. -         anum = 2;
  1688. -         arg->arg_type = optype = O_FLOP;
  1689.           arg[2].arg_type &= ~A_DONT;
  1690.           arg[1].arg_type |= A_DONT;
  1691. !         argflags = arg[2].arg_flags;
  1692. !         argtype = arg[2].arg_type & A_MASK;
  1693. !         argptr = arg[2].arg_ptr;
  1694. !         sp = arglast[0];
  1695. !         st -= sp++;
  1696. !         goto re_eval;
  1697.       }
  1698.       str_set(str,"");
  1699.       break;
  1700. --- 1894,1916 ----
  1701.         last_in_stab && (int)str_gnum(st[1]) == stab_io(last_in_stab)->lines
  1702.         :
  1703.         str_true(st[1]) ) {
  1704.           arg[2].arg_type &= ~A_DONT;
  1705.           arg[1].arg_type |= A_DONT;
  1706. !         arg->arg_type = optype = O_FLOP;
  1707. !         if (arg->arg_flags & AF_COMMON) {
  1708. !         str_numset(str,0.0);
  1709. !         anum = 2;
  1710. !         argflags = arg[2].arg_flags;
  1711. !         argtype = arg[2].arg_type & A_MASK;
  1712. !         argptr = arg[2].arg_ptr;
  1713. !         sp = arglast[0];
  1714. !         st -= sp++;
  1715. !         goto re_eval;
  1716. !         }
  1717. !         else {
  1718. !         str_numset(str,1.0);
  1719. !         break;
  1720. !         }
  1721.       }
  1722.       str_set(str,"");
  1723.       break;
  1724. ***************
  1725. *** 2862,2869 ****
  1726.           stab = stabent(str_get(st[1]),TRUE);
  1727.       if (!stab || !(stio = stab_io(stab)) || !(fp = stio->ifp))
  1728.           goto say_undef;
  1729. ! #ifdef MSDOS
  1730.       str_set(str, (setmode(fileno(fp), O_BINARY) != -1) ? Yes : No);
  1731.   #else
  1732.       str_set(str, Yes);
  1733.   #endif
  1734. --- 2893,2910 ----
  1735.           stab = stabent(str_get(st[1]),TRUE);
  1736.       if (!stab || !(stio = stab_io(stab)) || !(fp = stio->ifp))
  1737.           goto say_undef;
  1738. ! #ifdef DOSISH
  1739. ! #ifdef atarist
  1740. !     if(fflush(fp))
  1741. !        str_set(str, No);
  1742. !     else
  1743. !     {
  1744. !         fp->_flag |= _IOBIN;
  1745. !         str_set(str, Yes);
  1746. !     }
  1747. ! #else
  1748.       str_set(str, (setmode(fileno(fp), O_BINARY) != -1) ? Yes : No);
  1749. + #endif
  1750.   #else
  1751.       str_set(str, Yes);
  1752.   #endif
  1753. ***************
  1754. *** 2938,2944 ****
  1755.       case O_SYSCALL:
  1756.       value = (double)do_syscall(arglast);
  1757.       goto donumset;
  1758. !     case O_PIPE:
  1759.   #ifdef HAS_PIPE
  1760.       if ((arg[1].arg_type & A_MASK) == A_WORD)
  1761.           stab = arg[1].arg_ptr.arg_stab;
  1762. --- 2979,2985 ----
  1763.       case O_SYSCALL:
  1764.       value = (double)do_syscall(arglast);
  1765.       goto donumset;
  1766. !     case O_PIPE_OP:
  1767.   #ifdef HAS_PIPE
  1768.       if ((arg[1].arg_type & A_MASK) == A_WORD)
  1769.           stab = arg[1].arg_ptr.arg_stab;
  1770.  
  1771. Index: atarist/explain
  1772. *** atarist/explain.old    Mon Jun  8 17:35:13 1992
  1773. --- atarist/explain    Mon Jun  8 17:35:14 1992
  1774. ***************
  1775. *** 0 ****
  1776. --- 1,77 ----
  1777. + Here is a brief explaination of the diffs in perl.diffs. If anything
  1778. + is unclear please just ask:
  1779. + General:
  1780. +   Many of the  #ifdef MSDOS where required for the atari too. In order
  1781. + to avoid cluttering up the source, upfront in perl.h we #define
  1782. + MSDOS_OR_ATARI if either defined(MSDOS) or defined(atarist).
  1783. +  Some of the diffs that i felt were universally applicable are not protected
  1784. + with #ifdef's. In the explainations below i has indicated all such
  1785. + changes.
  1786. + perl.h:
  1787. +   -- define MSDOS_OR_ATARI if appro.
  1788. +   -- typedef size_t - assume its there in <stddef.h> if STANDARD_C otherwise
  1789. +      typedef it to unsigned int (i would have ideally liked unsigned long,
  1790. +      but we get into trouble with half-assed headers from sun etc)
  1791. + (this change not protected with a #ifdef since hopefully its universally appli)
  1792. +   -- make the type of STRLEN size_t for all systems
  1793. + (this change not protected with a #ifdef since hopefully its universally appli)
  1794. +   -- more #ifdef MSDOS -> #ifdef MSDOS_OR_ATARI changes.
  1795. + arg.h:
  1796. +   -- in the atari headers we already have O_PIPE. Change all instances of
  1797. +      O_PIPE to PERL_O_PIPE. All such changes protected with #ifdef atarist.
  1798. + handy.h:
  1799. +   -- make MEM_SIZE size_t like STRLEN.
  1800. + (this change not protected with a #ifdef since hopefully its universally appli)
  1801. + doarg.c:
  1802. +   -- accomodate the large number of args needed for the atari syscall().
  1803. +   -- do the 9 thru 14 arg versions of syscall for the atarist.
  1804. + doio.c:
  1805. +   -- mode[] needed to be  initialized.
  1806. + (this change not protected with a #ifdef since hopefully its universally appli)
  1807. +   -- you may find this strange, we do not define STDSTDIO, because even
  1808. +      though we have the "standard" field in FILE, the semantics are
  1809. +      different. However, some contexts will work correctly, and there
  1810. +      you will see #if defined(STDSTDIO) || defined(atarist)
  1811. +   -- more #ifdef MSDOS -> #ifdef MSDOS_OR_ATARI changes.
  1812. + eval.c:
  1813. +   -- more #ifdef MSDOS -> #ifdef MSDOS_OR_ATARI changes.
  1814. + malloc.c::
  1815. +   -- instead of bashfully using ints to hold sizes use MEM_SIZE.
  1816. +      adjust some casts and printf format specifiers due to this.
  1817. +      (atarigcc can run in two modes, with 16 or 32 bit ints, so...)
  1818. + (this change not protected with a #ifdef since hopefully its universally appli)
  1819. +   -- atarist changes sometimes ||'ed with I286 as appro.
  1820. + perl.c:
  1821. +   -- more #ifdef MSDOS -> #ifdef MSDOS_OR_ATARI changes.
  1822. + regcomp.c:
  1823. +   -- like O_PIPE the atarist headers already has META defined. Change all
  1824. +      instances of META to PERL_META. All such changes protected with
  1825. +      #ifdef atarist.
  1826. + str.c:
  1827. +   -- more #ifdef MSDOS -> #ifdef MSDOS_OR_ATARI changes.
  1828. + token.c::
  1829. +   -- META -> PERL_META renaming for atari
  1830. + util.c::
  1831. +   -- more adjustments for memory sizes being MEM_SIZE instead of int.
  1832. +   -- more #ifdef MSDOS -> #ifdef MSDOS_OR_ATARI changes.
  1833. + ++jrb  bammi@cadence.com
  1834.  
  1835. Index: lib/find.pl
  1836. *** lib/find.pl.old    Mon Jun  8 17:48:56 1992
  1837. --- lib/find.pl    Mon Jun  8 17:48:57 1992
  1838. ***************
  1839. *** 48,53 ****
  1840. --- 48,54 ----
  1841.           unless (($dir,$_) = $topdir =~ m#^(.*/)(.*)$#) {
  1842.           ($dir,$_) = ('.', $topdir);
  1843.           }
  1844. +         $name = $topdir;
  1845.           chdir $dir && &wanted;
  1846.       }
  1847.       chdir $cwd;
  1848. ***************
  1849. *** 61,67 ****
  1850.   
  1851.       # Get the list of files in the current directory.
  1852.   
  1853. !     opendir(DIR,'.') || warn "Can't open $dir: $!\n";
  1854.       local(@filenames) = readdir(DIR);
  1855.       closedir(DIR);
  1856.   
  1857. --- 62,68 ----
  1858.   
  1859.       # Get the list of files in the current directory.
  1860.   
  1861. !     opendir(DIR,'.') || (warn "Can't open $dir: $!\n", return);
  1862.       local(@filenames) = readdir(DIR);
  1863.       closedir(DIR);
  1864.   
  1865.  
  1866. Index: x2p/find2perl.SH
  1867. *** x2p/find2perl.SH.old    Mon Jun  8 17:52:56 1992
  1868. --- x2p/find2perl.SH    Mon Jun  8 17:52:56 1992
  1869. ***************
  1870. *** 6,12 ****
  1871.       ln ../../../config.sh . || \
  1872.       (echo "Can't find config.sh."; exit 1)
  1873.       fi
  1874. !     . config.sh
  1875.       ;;
  1876.   esac
  1877.   : This forces SH files to create target in same directory as SH file.
  1878. --- 6,12 ----
  1879.       ln ../../../config.sh . || \
  1880.       (echo "Can't find config.sh."; exit 1)
  1881.       fi
  1882. !     . ./config.sh
  1883.       ;;
  1884.   esac
  1885.   : This forces SH files to create target in same directory as SH file.
  1886. ***************
  1887. *** 19,27 ****
  1888. --- 19,31 ----
  1889.   : Move anything that needs config subs from !NO!SUBS! section to !GROK!THIS!.
  1890.   : Protect any dollar signs and backticks that you do not want interpreted
  1891.   : by putting a backslash in front.  You may delete these comments.
  1892. + rm -f find2perl
  1893.   $spitshell >find2perl <<!GROK!THIS!
  1894.   #!$bin/perl
  1895.   
  1896. + eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
  1897. +     if \$running_under_some_shell;
  1898.   \$bin = "$bin";
  1899.   
  1900.   !GROK!THIS!
  1901. ***************
  1902. *** 232,237 ****
  1903. --- 236,244 ----
  1904.   print <<"END";
  1905.   #!$bin/perl
  1906.   
  1907. + eval 'exec $bin/perl -S \$0 \${1+"\$@"}'
  1908. +     if \$running_under_some_shell;
  1909.   END
  1910.   
  1911.   if ($initls) {
  1912. ***************
  1913. *** 544,550 ****
  1914.   
  1915.       $tabstring = "\t" x ($indent / 2) . ' ' x ($indent % 2 * 4);
  1916.       if (!$statdone) {
  1917. !     if ($_ =~ /^(name|print)/) {
  1918.           $delayedstat++;
  1919.       }
  1920.       else {
  1921. --- 551,557 ----
  1922.   
  1923.       $tabstring = "\t" x ($indent / 2) . ' ' x ($indent % 2 * 4);
  1924.       if (!$statdone) {
  1925. !     if ($_ =~ /^(name|print|prune|exec|ok|\(|\))/) {
  1926.           $delayedstat++;
  1927.       }
  1928.       else {
  1929.  
  1930. Index: lib/getopts.pl
  1931. *** lib/getopts.pl.old    Mon Jun  8 17:48:58 1992
  1932. --- lib/getopts.pl    Mon Jun  8 17:48:59 1992
  1933. ***************
  1934. *** 18,23 ****
  1935. --- 18,24 ----
  1936.           if($args[$pos+1] eq ':') {
  1937.           shift(@ARGV);
  1938.           if($rest eq '') {
  1939. +             ++$errs unless @ARGV;
  1940.               $rest = shift(@ARGV);
  1941.           }
  1942.           eval "\$opt_$first = \$rest;";
  1943.  
  1944. *** End of Patch 25 ***
  1945. exit 0 # Just in case...
  1946.