home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume25 / perl / patch17 < prev    next >
Encoding:
Text File  |  1991-11-13  |  46.9 KB  |  1,932 lines

  1. Newsgroups: comp.sources.misc
  2. From: lwall@netlabs.com (Larry Wall)
  3. Subject:  v25i066:  perl - The perl programming language, Patch17
  4. Message-ID: <1991Nov13.214600.3968@sparky.imd.sterling.com>
  5. X-Md4-Signature: 2ca4c293c1a20f9300b96dd274f08234
  6. Date: Wed, 13 Nov 1991 21:46:00 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lwall@netlabs.com (Larry Wall)
  10. Posting-number: Volume 25, Issue 66
  11. Archive-name: perl/patch17
  12. Environment: UNIX, MS-DOS, OS2
  13. Patch-To: perl: Volume 18, Issue 19-54
  14.  
  15. System: perl version 4.0
  16. Patch #: 17
  17. Priority: MED-HIGH
  18. Subject: patch #11, continued
  19.  
  20. Description:
  21.     See patch #11.
  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 #18 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: 16
  56. 1c1
  57. < #define PATCHLEVEL 16
  58. ---
  59. > #define PATCHLEVEL 17
  60.  
  61. Index: str.h
  62. *** str.h.old    Tue Nov  5 19:27:58 1991
  63. --- str.h    Tue Nov  5 19:27:58 1991
  64. ***************
  65. *** 1,4 ****
  66. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:58:33 $
  67.    *
  68.    *    Copyright (c) 1991, Larry Wall
  69.    *
  70. --- 1,4 ----
  71. ! /* $RCSfile: str.h,v $$Revision: 4.0.1.3 $$Date: 91/11/05 18:41:47 $
  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.3  91/11/05  18:41:47  lwall
  82. +  * patch11: random cleanup
  83. +  * patch11: solitary subroutine references no longer trigger typo warnings
  84. +  * 
  85.    * Revision 4.0.1.2  91/06/07  11:58:33  lwall
  86.    * patch4: new copyright notice
  87.    * 
  88. ***************
  89. *** 32,39 ****
  90.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  91.       STR        *str_magic;    /* while free, link to next free str */
  92.                   /* while in use, ptr to "key" for magic items */
  93. !     char    str_pok;    /* state of str_ptr */
  94. !     char    str_nok;    /* state of str_nval */
  95.       unsigned char str_rare;    /* used by search strings */
  96.       unsigned char str_state;    /* one of SS_* below */
  97.                   /* also used by search strings for backoff */
  98. --- 36,43 ----
  99.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  100.       STR        *str_magic;    /* while free, link to next free str */
  101.                   /* while in use, ptr to "key" for magic items */
  102. !     unsigned char str_pok;    /* state of str_ptr */
  103. !     unsigned char str_nok;    /* state of str_nval */
  104.       unsigned char str_rare;    /* used by search strings */
  105.       unsigned char str_state;    /* one of SS_* below */
  106.                   /* also used by search strings for backoff */
  107. ***************
  108. *** 57,64 ****
  109.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  110.       STR        *str_magic;    /* while free, link to next free str */
  111.                   /* while in use, ptr to "key" for magic items */
  112. !     char    str_pok;    /* state of str_ptr */
  113. !     char    str_nok;    /* state of str_nval */
  114.       unsigned char str_rare;    /* used by search strings */
  115.       unsigned char str_state;    /* one of SS_* below */
  116.                   /* also used by search strings for backoff */
  117. --- 61,68 ----
  118.       STRLEN    str_cur;    /* length of str_ptr as a C string */
  119.       STR        *str_magic;    /* while free, link to next free str */
  120.                   /* while in use, ptr to "key" for magic items */
  121. !     unsigned char str_pok;    /* state of str_ptr */
  122. !     unsigned char str_nok;    /* state of str_nval */
  123.       unsigned char str_rare;    /* used by search strings */
  124.       unsigned char str_state;    /* one of SS_* below */
  125.                   /* also used by search strings for backoff */
  126. ***************
  127. *** 136,138 ****
  128. --- 140,144 ----
  129.   void str_magic();
  130.   void str_insert();
  131.   STRLEN str_len();
  132. + #define MULTI    (3)
  133.  
  134. Index: t/cmd/subval.t
  135. Prereq: 4.0
  136. *** t/cmd/subval.t.old    Tue Nov  5 19:28:00 1991
  137. --- t/cmd/subval.t    Tue Nov  5 19:28:00 1991
  138. ***************
  139. *** 1,6 ****
  140.   #!./perl
  141.   
  142. ! # $Header: subval.t,v 4.0 91/03/20 01:49:40 lwall Locked $
  143.   
  144.   sub foo1 {
  145.       'true1';
  146. --- 1,6 ----
  147.   #!./perl
  148.   
  149. ! # $RCSfile: subval.t,v $$Revision: 4.0.1.1 $$Date: 91/11/05 18:42:31 $
  150.   
  151.   sub foo1 {
  152.       'true1';
  153. ***************
  154. *** 102,108 ****
  155.   sub somesub {
  156.       local($num,$P,$F,$L) = @_;
  157.       ($p,$f,$l) = caller;
  158. !     print "$p:$f:$l" eq "$P:$F:$L" ? "ok $num\n" : "not ok $num\n";
  159.   }
  160.   
  161.   &somesub(27, 'main', __FILE__, __LINE__);
  162. --- 102,108 ----
  163.   sub somesub {
  164.       local($num,$P,$F,$L) = @_;
  165.       ($p,$f,$l) = caller;
  166. !     print "$p:$f:$l" eq "$P:$F:$L" ? "ok $num\n" : "not ok $num $p:$f:$l ne $P:$F:$L\n";
  167.   }
  168.   
  169.   &somesub(27, 'main', __FILE__, __LINE__);
  170.  
  171. Index: hints/sunos_4_0_1.sh
  172. *** hints/sunos_4_0_1.sh.old    Tue Nov  5 19:26:39 1991
  173. --- hints/sunos_4_0_1.sh    Tue Nov  5 19:26:39 1991
  174. ***************
  175. *** 1 ****
  176. ! $ccflags="$ccflags -DFPUTS_BOTCH"
  177. --- 1 ----
  178. ! ccflags="$ccflags -DFPUTS_BOTCH"
  179.  
  180. Index: hints/sunos_4_0_2.sh
  181. *** hints/sunos_4_0_2.sh.old    Tue Nov  5 19:26:41 1991
  182. --- hints/sunos_4_0_2.sh    Tue Nov  5 19:26:41 1991
  183. ***************
  184. *** 1 ****
  185. ! $ccflags="$ccflags -DFPUTS_BOTCH"
  186. --- 1 ----
  187. ! ccflags="$ccflags -DFPUTS_BOTCH"
  188.  
  189. Index: hints/ti1500.sh
  190. *** hints/ti1500.sh.old    Tue Nov  5 19:26:43 1991
  191. --- hints/ti1500.sh    Tue Nov  5 19:26:43 1991
  192. ***************
  193. *** 0 ****
  194. --- 1 ----
  195. + d_mymalloc='undef'
  196.  
  197. Index: toke.c
  198. *** toke.c.old    Tue Nov  5 19:28:09 1991
  199. --- toke.c    Tue Nov  5 19:28:10 1991
  200. ***************
  201. *** 1,4 ****
  202. ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.3 $$Date: 91/06/10 01:32:26 $
  203.    *
  204.    *    Copyright (c) 1991, Larry Wall
  205.    *
  206. --- 1,4 ----
  207. ! /* $RCSfile: toke.c,v $$Revision: 4.0.1.4 $$Date: 91/11/05 19:02:48 $
  208.    *
  209.    *    Copyright (c) 1991, Larry Wall
  210.    *
  211. ***************
  212. *** 6,11 ****
  213. --- 6,19 ----
  214.    *    License or the Artistic License, as specified in the README file.
  215.    *
  216.    * $Log:    toke.c,v $
  217. +  * Revision 4.0.1.4  91/11/05  19:02:48  lwall
  218. +  * patch11: \x and \c were subject to double interpretation in regexps
  219. +  * patch11: prepared for ctype implementations that don't define isascii()
  220. +  * patch11: nested list operators could miscount parens
  221. +  * patch11: once-thru blocks didn't display right in the debugger
  222. +  * patch11: sort eval "whatever" didn't work
  223. +  * patch11: underscore is now allowed within literal octal and hex numbers
  224. +  * 
  225.    * Revision 4.0.1.3  91/06/10  01:32:26  lwall
  226.    * patch10: m'$foo' now treats string as single quoted
  227.    * patch10: certain pattern optimizations were botched
  228. ***************
  229. *** 41,47 ****
  230.   
  231.   /* which backslash sequences to keep in m// or s// */
  232.   
  233. ! static char *patleave = "\\.^$@dDwWsSbB+*?|()-nrtf0123456789[{]}";
  234.   
  235.   char *reparse;        /* if non-null, scanident found ${foo[$bar]} */
  236.   
  237. --- 49,55 ----
  238.   
  239.   /* which backslash sequences to keep in m// or s// */
  240.   
  241. ! static char *patleave = "\\.^$@dDwWsSbB+*?|()-nrtfeaxc0123456789[{]}";
  242.   
  243.   char *reparse;        /* if non-null, scanident found ${foo[$bar]} */
  244.   
  245. ***************
  246. *** 92,98 ****
  247.    * paren came before the listop rather than after.
  248.    */
  249.   #define LOP(f) return(CLINE, *s == '(' || (s = skipspace(s), *s == '(') ? \
  250. !     (*s = META('('), bufptr = oldbufptr, '(') : \
  251.       (yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP))
  252.   /* grandfather return to old style */
  253.   #define OLDLOP(f) return(yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP)
  254. --- 100,106 ----
  255.    * paren came before the listop rather than after.
  256.    */
  257.   #define LOP(f) return(CLINE, *s == '(' || (s = skipspace(s), *s == '(') ? \
  258. !     (*s = (char) META('('), bufptr = oldbufptr, '(') : \
  259.       (yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP))
  260.   /* grandfather return to old style */
  261.   #define OLDLOP(f) return(yylval.ival=f,expectterm = TRUE,bufptr = s,(int)LISTOP)
  262. ***************
  263. *** 101,107 ****
  264.   skipspace(s)
  265.   register char *s;
  266.   {
  267. !     while (s < bufend && isascii(*s) && isspace(*s))
  268.       s++;
  269.       return s;
  270.   }
  271. --- 109,115 ----
  272.   skipspace(s)
  273.   register char *s;
  274.   {
  275. !     while (s < bufend && isSPACE(*s))
  276.       s++;
  277.       return s;
  278.   }
  279. ***************
  280. *** 175,182 ****
  281.   #endif
  282.   #ifdef BADSWITCH
  283.       if (*s & 128) {
  284. !     if ((*s & 127) == '(')
  285.           *s++ = '(';
  286.       else
  287.           warn("Unrecognized character \\%03o ignored", *s++ & 255);
  288.       goto retry;
  289. --- 183,192 ----
  290.   #endif
  291.   #ifdef BADSWITCH
  292.       if (*s & 128) {
  293. !     if ((*s & 127) == '(') {
  294.           *s++ = '(';
  295. +         oldbufptr = s;
  296. +     }
  297.       else
  298.           warn("Unrecognized character \\%03o ignored", *s++ & 255);
  299.       goto retry;
  300. ***************
  301. *** 184,191 ****
  302.   #endif
  303.       switch (*s) {
  304.       default:
  305. !     if ((*s & 127) == '(')
  306.           *s++ = '(';
  307.       else
  308.           warn("Unrecognized character \\%03o ignored", *s++ & 255);
  309.       goto retry;
  310. --- 194,203 ----
  311.   #endif
  312.       switch (*s) {
  313.       default:
  314. !     if ((*s & 127) == '(') {
  315.           *s++ = '(';
  316. +         oldbufptr = s;
  317. +     }
  318.       else
  319.           warn("Unrecognized character \\%03o ignored", *s++ & 255);
  320.       goto retry;
  321. ***************
  322. *** 238,244 ****
  323.           if (rsfp) {
  324.               if (preprocess)
  325.               (void)mypclose(rsfp);
  326. !             else if (rsfp == stdin)
  327.               clearerr(stdin);
  328.               else
  329.               (void)fclose(rsfp);
  330. --- 250,256 ----
  331.           if (rsfp) {
  332.               if (preprocess)
  333.               (void)mypclose(rsfp);
  334. !             else if ((FILE*)rsfp == stdin)
  335.               clearerr(stdin);
  336.               else
  337.               (void)fclose(rsfp);
  338. ***************
  339. *** 283,297 ****
  340.               if (*s == ' ')
  341.               s++;
  342.               cmd = s;
  343. !             while (s < bufend && !isspace(*s))
  344.               s++;
  345.               *s++ = '\0';
  346. !             while (s < bufend && isspace(*s))
  347.               s++;
  348.               if (s < bufend) {
  349.               Newz(899,newargv,origargc+3,char*);
  350.               newargv[1] = s;
  351. !             while (s < bufend && !isspace(*s))
  352.                   s++;
  353.               *s = '\0';
  354.               Copy(origargv+1, newargv+2, origargc+1, char*);
  355. --- 295,309 ----
  356.               if (*s == ' ')
  357.               s++;
  358.               cmd = s;
  359. !             while (s < bufend && !isSPACE(*s))
  360.               s++;
  361.               *s++ = '\0';
  362. !             while (s < bufend && isSPACE(*s))
  363.               s++;
  364.               if (s < bufend) {
  365.               Newz(899,newargv,origargc+3,char*);
  366.               newargv[1] = s;
  367. !             while (s < bufend && !isSPACE(*s))
  368.                   s++;
  369.               *s = '\0';
  370.               Copy(origargv+1, newargv+2, origargc+1, char*);
  371. ***************
  372. *** 304,310 ****
  373.           }
  374.           }
  375.           else {
  376. !         while (s < bufend && isspace(*s))
  377.               s++;
  378.           if (*s == ':')    /* for csh's that have to exec sh scripts */
  379.               s++;
  380. --- 316,322 ----
  381.           }
  382.           }
  383.           else {
  384. !         while (s < bufend && isSPACE(*s))
  385.               s++;
  386.           if (*s == ':')    /* for csh's that have to exec sh scripts */
  387.               s++;
  388. ***************
  389. *** 316,326 ****
  390.       goto retry;
  391.       case '#':
  392.       if (preprocess && s == str_get(linestr) &&
  393. !            s[1] == ' ' && isdigit(s[2])) {
  394. !         curcmd->c_line = atoi(s+2)-1;
  395. !         for (s += 2; isdigit(*s); s++) ;
  396.           d = bufend;
  397. !         while (s < d && isspace(*s)) s++;
  398.           s[strlen(s)-1] = '\0';    /* wipe out newline */
  399.           if (*s == '"') {
  400.           s++;
  401. --- 328,341 ----
  402.       goto retry;
  403.       case '#':
  404.       if (preprocess && s == str_get(linestr) &&
  405. !            s[1] == ' ' && (isDIGIT(s[2]) || strnEQ(s+2,"line ",5)) ) {
  406. !         while (*s && !isDIGIT(*s))
  407. !         s++;
  408. !         curcmd->c_line = atoi(s)-1;
  409. !         while (isDIGIT(*s))
  410. !         s++;
  411.           d = bufend;
  412. !         while (s < d && isSPACE(*s)) s++;
  413.           s[strlen(s)-1] = '\0';    /* wipe out newline */
  414.           if (*s == '"') {
  415.           s++;
  416. ***************
  417. *** 355,361 ****
  418.       }
  419.       goto retry;
  420.       case '-':
  421. !     if (s[1] && isalpha(s[1]) && !isalpha(s[2])) {
  422.           s++;
  423.           switch (*s++) {
  424.           case 'r': FTST(O_FTEREAD);
  425. --- 370,376 ----
  426.       }
  427.       goto retry;
  428.       case '-':
  429. !     if (s[1] && isALPHA(s[1]) && !isALPHA(s[2])) {
  430.           s++;
  431.           switch (*s++) {
  432.           case 'r': FTST(O_FTEREAD);
  433. ***************
  434. *** 441,447 ****
  435.       OPERATOR(tmp);
  436.       case '{':
  437.       tmp = *s++;
  438. !     if (isspace(*s) || *s == '#')
  439.           cmdline = NOLINE;   /* invalidate current command line number */
  440.       OPERATOR(tmp);
  441.       case ';':
  442. --- 456,463 ----
  443.       OPERATOR(tmp);
  444.       case '{':
  445.       tmp = *s++;
  446. !     yylval.ival = curcmd->c_line;
  447. !     if (isSPACE(*s) || *s == '#')
  448.           cmdline = NOLINE;   /* invalidate current command line number */
  449.       OPERATOR(tmp);
  450.       case ';':
  451. ***************
  452. *** 464,472 ****
  453.       s--;
  454.       if (expectterm) {
  455.           d = bufend;
  456. !         while (s < d && isspace(*s))
  457.           s++;
  458. !         if (isalpha(*s) || *s == '_' || *s == '\'')
  459.           *(--s) = '\\';    /* force next ident to WORD */
  460.           OPERATOR(AMPER);
  461.       }
  462. --- 480,488 ----
  463.       s--;
  464.       if (expectterm) {
  465.           d = bufend;
  466. !         while (s < d && isSPACE(*s))
  467.           s++;
  468. !         if (isALPHA(*s) || *s == '_' || *s == '\'')
  469.           *(--s) = '\\';    /* force next ident to WORD */
  470.           OPERATOR(AMPER);
  471.       }
  472. ***************
  473. *** 526,533 ****
  474.   
  475.   #define SNARFWORD \
  476.       d = tokenbuf; \
  477. !     while (isascii(*s) && \
  478. !       (isalpha(*s) || isdigit(*s) || *s == '_' || *s == '\'')) \
  479.           *d++ = *s++; \
  480.       while (d[-1] == '\'') \
  481.           d--,s--; \
  482. --- 542,548 ----
  483.   
  484.   #define SNARFWORD \
  485.       d = tokenbuf; \
  486. !     while (isALNUM(*s) || *s == '\'') \
  487.           *d++ = *s++; \
  488.       while (d[-1] == '\'') \
  489.           d--,s--; \
  490. ***************
  491. *** 535,541 ****
  492.       d = tokenbuf;
  493.   
  494.       case '$':
  495. !     if (s[1] == '#' && (isalpha(s[2]) || s[2] == '_')) {
  496.           s++;
  497.           s = scanident(s,bufend,tokenbuf);
  498.           yylval.stabval = aadd(stabent(tokenbuf,TRUE));
  499. --- 550,556 ----
  500.       d = tokenbuf;
  501.   
  502.       case '$':
  503. !     if (s[1] == '#' && (isALPHA(s[2]) || s[2] == '_')) {
  504.           s++;
  505.           s = scanident(s,bufend,tokenbuf);
  506.           yylval.stabval = aadd(stabent(tokenbuf,TRUE));
  507. ***************
  508. *** 574,580 ****
  509.       OPERATOR(tmp);
  510.   
  511.       case '.':
  512. !     if (!expectterm || !isdigit(s[1])) {
  513.           tmp = *s++;
  514.           if (*s == tmp) {
  515.           s++;
  516. --- 589,595 ----
  517.       OPERATOR(tmp);
  518.   
  519.       case '.':
  520. !     if (!expectterm || !isDIGIT(s[1])) {
  521.           tmp = *s++;
  522.           if (*s == tmp) {
  523.           s++;
  524. ***************
  525. *** 613,618 ****
  526. --- 628,634 ----
  527.           STAB *stab;
  528.           int fd;
  529.   
  530. +         /*SUPPRESS 560*/
  531.           if (stab = stabent("DATA",FALSE)) {
  532.               stab->str_pok |= SP_MULTI;
  533.               stab_io(stab) = stio_new();
  534. ***************
  535. *** 623,629 ****
  536.   #endif
  537.               if (preprocess)
  538.               stab_io(stab)->type = '|';
  539. !             else if (rsfp == stdin)
  540.               stab_io(stab)->type = '-';
  541.               else
  542.               stab_io(stab)->type = '<';
  543. --- 639,645 ----
  544.   #endif
  545.               if (preprocess)
  546.               stab_io(stab)->type = '|';
  547. !             else if ((FILE*)rsfp == stdin)
  548.               stab_io(stab)->type = '-';
  549.               else
  550.               stab_io(stab)->type = '<';
  551. ***************
  552. *** 670,676 ****
  553.           UNI(O_CALLER);
  554.       if (strEQ(d,"crypt")) {
  555.   #ifdef FCRYPT
  556. !         init_des();
  557.   #endif
  558.           FUN2(O_CRYPT);
  559.       }
  560. --- 686,695 ----
  561.           UNI(O_CALLER);
  562.       if (strEQ(d,"crypt")) {
  563.   #ifdef FCRYPT
  564. !         static int cryptseen = 0;
  565. !         if (!cryptseen++)
  566. !         init_des();
  567.   #endif
  568.           FUN2(O_CRYPT);
  569.       }
  570. ***************
  571. *** 689,697 ****
  572.       SNARFWORD;
  573.       if (strEQ(d,"do")) {
  574.           d = bufend;
  575. !         while (s < d && isspace(*s))
  576.           s++;
  577. !         if (isalpha(*s) || *s == '_')
  578.           *(--s) = '\\';    /* force next ident to WORD */
  579.           OPERATOR(DO);
  580.       }
  581. --- 708,716 ----
  582.       SNARFWORD;
  583.       if (strEQ(d,"do")) {
  584.           d = bufend;
  585. !         while (s < d && isSPACE(*s))
  586.           s++;
  587. !         if (isALPHA(*s) || *s == '_')
  588.           *(--s) = '\\';    /* force next ident to WORD */
  589.           OPERATOR(DO);
  590.       }
  591. ***************
  592. *** 755,763 ****
  593.       }
  594.       if (strEQ(d,"format")) {
  595.           d = bufend;
  596. !         while (s < d && isspace(*s))
  597.           s++;
  598. !         if (isalpha(*s) || *s == '_')
  599.           *(--s) = '\\';    /* force next ident to WORD */
  600.           in_format = TRUE;
  601.           allstabs = TRUE;        /* must initialize everything since */
  602. --- 774,782 ----
  603.       }
  604.       if (strEQ(d,"format")) {
  605.           d = bufend;
  606. !         while (s < d && isSPACE(*s))
  607.           s++;
  608. !         if (isALPHA(*s) || *s == '_')
  609.           *(--s) = '\\';    /* force next ident to WORD */
  610.           in_format = TRUE;
  611.           allstabs = TRUE;        /* must initialize everything since */
  612. ***************
  613. *** 1125,1135 ****
  614.           if (strEQ(d,"sort")) {
  615.           checkcomma(s,"subroutine name");
  616.           d = bufend;
  617. !         while (s < d && isascii(*s) && isspace(*s)) s++;
  618.           if (*s == ';' || *s == ')')        /* probably a close */
  619.               fatal("sort is now a reserved word");
  620. !         if (isascii(*s) && (isalpha(*s) || *s == '_')) {
  621. !             for (d = s; isalpha(*d) || isdigit(*d) || *d == '_'; d++) ;
  622.               strncpy(tokenbuf,s,d-s);
  623.               if (strNE(tokenbuf,"keys") &&
  624.               strNE(tokenbuf,"values") &&
  625. --- 1144,1155 ----
  626.           if (strEQ(d,"sort")) {
  627.           checkcomma(s,"subroutine name");
  628.           d = bufend;
  629. !         while (s < d && isSPACE(*s)) s++;
  630.           if (*s == ';' || *s == ')')        /* probably a close */
  631.               fatal("sort is now a reserved word");
  632. !         if (isALPHA(*s) || *s == '_') {
  633. !             /*SUPPRESS 530*/
  634. !             for (d = s; isALNUM(*d); d++) ;
  635.               strncpy(tokenbuf,s,d-s);
  636.               if (strNE(tokenbuf,"keys") &&
  637.               strNE(tokenbuf,"values") &&
  638. ***************
  639. *** 1138,1144 ****
  640.               strNE(tokenbuf,"readdir") &&
  641.               strNE(tokenbuf,"unpack") &&
  642.               strNE(tokenbuf,"do") &&
  643. !             (d >= bufend || isspace(*d)) )
  644.               *(--s) = '\\';    /* force next ident to WORD */
  645.           }
  646.           LOP(O_SORT);
  647. --- 1158,1165 ----
  648.               strNE(tokenbuf,"readdir") &&
  649.               strNE(tokenbuf,"unpack") &&
  650.               strNE(tokenbuf,"do") &&
  651. !             strNE(tokenbuf,"eval") &&
  652. !             (d >= bufend || isSPACE(*d)) )
  653.               *(--s) = '\\';    /* force next ident to WORD */
  654.           }
  655.           LOP(O_SORT);
  656. ***************
  657. *** 1176,1192 ****
  658.           if (strEQ(d,"substr"))
  659.           FUN2x(O_SUBSTR);
  660.           if (strEQ(d,"sub")) {
  661.           subline = curcmd->c_line;
  662.           d = bufend;
  663. !         while (s < d && isspace(*s))
  664.               s++;
  665. !         if (isalpha(*s) || *s == '_' || *s == '\'') {
  666.               if (perldb) {
  667.               str_sset(subname,curstname);
  668.               str_ncat(subname,"'",1);
  669. !             for (d = s+1;
  670. !               isalpha(*d) || isdigit(*d) || *d == '_' || *d == '\'';
  671. !               d++);
  672.               if (d[-1] == '\'')
  673.                   d--;
  674.               str_ncat(subname,s,d-s);
  675. --- 1197,1219 ----
  676.           if (strEQ(d,"substr"))
  677.           FUN2x(O_SUBSTR);
  678.           if (strEQ(d,"sub")) {
  679. +         yylval.ival = savestack->ary_fill; /* restore stuff on reduce */
  680. +         if (perldb) {
  681. +             savelong(&subline);
  682. +             saveitem(subname);
  683. +         }
  684.           subline = curcmd->c_line;
  685.           d = bufend;
  686. !         while (s < d && isSPACE(*s))
  687.               s++;
  688. !         if (isALPHA(*s) || *s == '_' || *s == '\'') {
  689.               if (perldb) {
  690.               str_sset(subname,curstname);
  691.               str_ncat(subname,"'",1);
  692. !             for (d = s+1; isALNUM(*d) || *d == '\''; d++)
  693. !                 /*SUPPRESS 530*/
  694. !                 ;
  695.               if (d[-1] == '\'')
  696.                   d--;
  697.               str_ncat(subname,s,d-s);
  698. ***************
  699. *** 1322,1328 ****
  700.       yylval.cval = savestr(d);
  701.       expectterm = FALSE;
  702.       if (oldoldbufptr && oldoldbufptr < bufptr) {
  703. !     while (isspace(*oldoldbufptr))
  704.           oldoldbufptr++;
  705.       if (*oldoldbufptr == 'p' && strnEQ(oldoldbufptr,"print",5))
  706.           expectterm = TRUE;
  707. --- 1349,1355 ----
  708.       yylval.cval = savestr(d);
  709.       expectterm = FALSE;
  710.       if (oldoldbufptr && oldoldbufptr < bufptr) {
  711. !     while (isSPACE(*oldoldbufptr))
  712.           oldoldbufptr++;
  713.       if (*oldoldbufptr == 'p' && strnEQ(oldoldbufptr,"print",5))
  714.           expectterm = TRUE;
  715. ***************
  716. *** 1341,1353 ****
  717.   
  718.       if (*s == '(')
  719.       s++;
  720. !     while (s < bufend && isascii(*s) && isspace(*s))
  721.       s++;
  722. !     if (isascii(*s) && (isalpha(*s) || *s == '_')) {
  723.       someword = s++;
  724. !     while (isalpha(*s) || isdigit(*s) || *s == '_')
  725.           s++;
  726. !     while (s < bufend && isspace(*s))
  727.           s++;
  728.       if (*s == ',') {
  729.           *s = '\0';
  730. --- 1368,1380 ----
  731.   
  732.       if (*s == '(')
  733.       s++;
  734. !     while (s < bufend && isSPACE(*s))
  735.       s++;
  736. !     if (isALPHA(*s) || *s == '_') {
  737.       someword = s++;
  738. !     while (isALNUM(*s))
  739.           s++;
  740. !     while (s < bufend && isSPACE(*s))
  741.           s++;
  742.       if (*s == ',') {
  743.           *s = '\0';
  744. ***************
  745. *** 1375,1386 ****
  746.       reparse = Nullch;
  747.       s++;
  748.       d = dest;
  749. !     if (isdigit(*s)) {
  750. !     while (isdigit(*s))
  751.           *d++ = *s++;
  752.       }
  753.       else {
  754. !     while (isalpha(*s) || isdigit(*s) || *s == '_' || *s == '\'')
  755.           *d++ = *s++;
  756.       }
  757.       while (d > dest+1 && d[-1] == '\'')
  758. --- 1402,1413 ----
  759.       reparse = Nullch;
  760.       s++;
  761.       d = dest;
  762. !     if (isDIGIT(*s)) {
  763. !     while (isDIGIT(*s))
  764.           *d++ = *s++;
  765.       }
  766.       else {
  767. !     while (isALNUM(*s) || *s == '\'')
  768.           *d++ = *s++;
  769.       }
  770.       while (d > dest+1 && d[-1] == '\'')
  771. ***************
  772. *** 1393,1400 ****
  773.           d = dest;
  774.           brackets++;
  775.           while (s < send && brackets) {
  776. !         if (!reparse && (d == dest || (*s && isascii(*s) &&
  777. !           (isalpha(*s) || isdigit(*s) || *s == '_') ))) {
  778.               *d++ = *s++;
  779.               continue;
  780.           }
  781. --- 1420,1426 ----
  782.           d = dest;
  783.           brackets++;
  784.           while (s < send && brackets) {
  785. !         if (!reparse && (d == dest || (*s && isALNUM(*s) ))) {
  786.               *d++ = *s++;
  787.               continue;
  788.           }
  789. ***************
  790. *** 1418,1435 ****
  791.       else
  792.           d[1] = '\0';
  793.       }
  794. !     if (*d == '^' && (isupper(*s) || index("[\\]^_?",*s)))
  795.       *d = *s++ ^ 64;
  796.       return s;
  797.   }
  798.   
  799. ! STR *
  800.   scanconst(spat,string,len)
  801.   SPAT *spat;
  802.   char *string;
  803.   int len;
  804.   {
  805. !     register STR *retstr;
  806.       register char *t;
  807.       register char *d;
  808.       register char *e;
  809. --- 1444,1466 ----
  810.       else
  811.           d[1] = '\0';
  812.       }
  813. !     if (*d == '^' && (isUPPER(*s) || index("[\\]^_?", *s))) {
  814. ! #ifdef DEBUGGING
  815. !     if (*s == 'D')
  816. !         debug |= 32768;
  817. ! #endif
  818.       *d = *s++ ^ 64;
  819. +     }
  820.       return s;
  821.   }
  822.   
  823. ! void
  824.   scanconst(spat,string,len)
  825.   SPAT *spat;
  826.   char *string;
  827.   int len;
  828.   {
  829. !     register STR *tmpstr;
  830.       register char *t;
  831.       register char *d;
  832.       register char *e;
  833. ***************
  834. *** 1437,1463 ****
  835.       static char *vert = "|";
  836.   
  837.       if (ninstr(string, string+len, vert, vert+1))
  838. !     return Nullstr;
  839.       if (*string == '^')
  840.       string++, len--;
  841. !     retstr = Str_new(86,len);
  842. !     str_nset(retstr,string,len);
  843. !     t = str_get(retstr);
  844.       e = t + len;
  845. !     retstr->str_u.str_useful = 100;
  846.       for (d=t; d < e; ) {
  847.       switch (*d) {
  848.       case '{':
  849. !         if (isdigit(d[1]))
  850.           e = d;
  851.           else
  852.           goto defchar;
  853.           break;
  854.       case '.': case '[': case '$': case '(': case ')': case '|': case '+':
  855.           e = d;
  856.           break;
  857.       case '\\':
  858. !         if (d[1] && index("wWbB0123456789sSdDlLuUE",d[1])) {
  859.           e = d;
  860.           break;
  861.           }
  862. --- 1468,1495 ----
  863.       static char *vert = "|";
  864.   
  865.       if (ninstr(string, string+len, vert, vert+1))
  866. !     return;
  867.       if (*string == '^')
  868.       string++, len--;
  869. !     tmpstr = Str_new(86,len);
  870. !     str_nset(tmpstr,string,len);
  871. !     t = str_get(tmpstr);
  872.       e = t + len;
  873. !     tmpstr->str_u.str_useful = 100;
  874.       for (d=t; d < e; ) {
  875.       switch (*d) {
  876.       case '{':
  877. !         if (isDIGIT(d[1]))
  878.           e = d;
  879.           else
  880.           goto defchar;
  881.           break;
  882.       case '.': case '[': case '$': case '(': case ')': case '|': case '+':
  883. +     case '^':
  884.           e = d;
  885.           break;
  886.       case '\\':
  887. !         if (d[1] && index("wWbB0123456789sSdDlLuUExc",d[1])) {
  888.           e = d;
  889.           break;
  890.           }
  891. ***************
  892. *** 1494,1511 ****
  893.       }
  894.       }
  895.       if (d == t) {
  896. !     str_free(retstr);
  897. !     return Nullstr;
  898.       }
  899.       *d = '\0';
  900. !     retstr->str_cur = d - t;
  901.       if (d == t+len)
  902.       spat->spat_flags |= SPAT_ALL;
  903.       if (*origstring != '^')
  904.       spat->spat_flags |= SPAT_SCANFIRST;
  905. !     spat->spat_short = retstr;
  906.       spat->spat_slen = d - t;
  907. -     return retstr;
  908.   }
  909.   
  910.   char *
  911. --- 1526,1542 ----
  912.       }
  913.       }
  914.       if (d == t) {
  915. !     str_free(tmpstr);
  916. !     return;
  917.       }
  918.       *d = '\0';
  919. !     tmpstr->str_cur = d - t;
  920.       if (d == t+len)
  921.       spat->spat_flags |= SPAT_ALL;
  922.       if (*origstring != '^')
  923.       spat->spat_flags |= SPAT_SCANFIRST;
  924. !     spat->spat_short = tmpstr;
  925.       spat->spat_slen = d - t;
  926.   }
  927.   
  928.   char *
  929. ***************
  930. *** 1663,1677 ****
  931.           arg->arg_type = O_ITEM;
  932.           arg[1].arg_type = A_DOUBLE;
  933.           arg[1].arg_ptr.arg_str = str_smake(str);
  934. !         d = scanident(d,bufend,buf);
  935.           (void)stabent(buf,TRUE);        /* make sure it's created */
  936.           for (; *d; d++) {
  937.           if (*d == '$' && d[1] && d[-1] != '\\' && d[1] != '|') {
  938. !             d = scanident(d,bufend,buf);
  939.               (void)stabent(buf,TRUE);
  940.           }
  941.           else if (*d == '@' && d[-1] != '\\') {
  942. !             d = scanident(d,bufend,buf);
  943.               if (strEQ(buf,"ARGV") || strEQ(buf,"ENV") ||
  944.                 strEQ(buf,"SIG") || strEQ(buf,"INC"))
  945.               (void)stabent(buf,TRUE);
  946. --- 1694,1708 ----
  947.           arg->arg_type = O_ITEM;
  948.           arg[1].arg_type = A_DOUBLE;
  949.           arg[1].arg_ptr.arg_str = str_smake(str);
  950. !         d = scanident(d,e,buf);
  951.           (void)stabent(buf,TRUE);        /* make sure it's created */
  952.           for (; *d; d++) {
  953.           if (*d == '$' && d[1] && d[-1] != '\\' && d[1] != '|') {
  954. !             d = scanident(d,e,buf);
  955.               (void)stabent(buf,TRUE);
  956.           }
  957.           else if (*d == '@' && d[-1] != '\\') {
  958. !             d = scanident(d,e,buf);
  959.               if (strEQ(buf,"ARGV") || strEQ(buf,"ENV") ||
  960.                 strEQ(buf,"SIG") || strEQ(buf,"INC"))
  961.               (void)stabent(buf,TRUE);
  962. ***************
  963. *** 1701,1707 ****
  964.       e = tmpstr->str_ptr + tmpstr->str_cur;
  965.       for (t = tmpstr->str_ptr; t < e; t++) {
  966.           if (*t == '$' && t[1] && (index("`'&+0123456789",t[1]) ||
  967. !           (t[1] == '{' /*}*/ && isdigit(t[2])) ))
  968.           spat->spat_flags &= ~SPAT_CONST;
  969.       }
  970.       }
  971. --- 1732,1738 ----
  972.       e = tmpstr->str_ptr + tmpstr->str_cur;
  973.       for (t = tmpstr->str_ptr; t < e; t++) {
  974.           if (*t == '$' && t[1] && (index("`'&+0123456789",t[1]) ||
  975. !           (t[1] == '{' /*}*/ && isDIGIT(t[2])) ))
  976.           spat->spat_flags &= ~SPAT_CONST;
  977.       }
  978.       }
  979. ***************
  980. *** 1710,1716 ****
  981.           s++;
  982.           if ((spat->spat_repl[1].arg_type & A_MASK) == A_DOUBLE)
  983.           spat->spat_repl[1].arg_type = A_SINGLE;
  984. !         spat->spat_repl = make_op(O_EVAL,2,
  985.           spat->spat_repl,
  986.           Nullarg,
  987.           Nullarg);
  988. --- 1741,1749 ----
  989.           s++;
  990.           if ((spat->spat_repl[1].arg_type & A_MASK) == A_DOUBLE)
  991.           spat->spat_repl[1].arg_type = A_SINGLE;
  992. !         spat->spat_repl = make_op(
  993. !         (spat->spat_repl[1].arg_type == A_SINGLE ? O_EVALONCE : O_EVAL),
  994. !         2,
  995.           spat->spat_repl,
  996.           Nullarg,
  997.           Nullarg);
  998. ***************
  999. *** 1950,1955 ****
  1000. --- 1983,1991 ----
  1001.           switch (*s) {
  1002.           default:
  1003.               goto out;
  1004. +         case '_':
  1005. +             s++;
  1006. +             break;
  1007.           case '8': case '9':
  1008.               if (shift != 4)
  1009.               yyerror("Illegal octal digit");
  1010. ***************
  1011. *** 1984,1990 ****
  1012.         decimal:
  1013.       arg[1].arg_type = A_SINGLE;
  1014.       d = tokenbuf;
  1015. !     while (isdigit(*s) || *s == '_') {
  1016.           if (*s == '_')
  1017.           s++;
  1018.           else
  1019. --- 2020,2026 ----
  1020.         decimal:
  1021.       arg[1].arg_type = A_SINGLE;
  1022.       d = tokenbuf;
  1023. !     while (isDIGIT(*s) || *s == '_') {
  1024.           if (*s == '_')
  1025.           s++;
  1026.           else
  1027. ***************
  1028. *** 1992,1998 ****
  1029.       }
  1030.       if (*s == '.' && s[1] && index("0123456789eE ;",s[1])) {
  1031.           *d++ = *s++;
  1032. !         while (isdigit(*s) || *s == '_') {
  1033.           if (*s == '_')
  1034.               s++;
  1035.           else
  1036. --- 2028,2034 ----
  1037.       }
  1038.       if (*s == '.' && s[1] && index("0123456789eE ;",s[1])) {
  1039.           *d++ = *s++;
  1040. !         while (isDIGIT(*s) || *s == '_') {
  1041.           if (*s == '_')
  1042.               s++;
  1043.           else
  1044. ***************
  1045. *** 2003,2009 ****
  1046.           *d++ = *s++;
  1047.           if (*s == '+' || *s == '-')
  1048.           *d++ = *s++;
  1049. !         while (isdigit(*s))
  1050.           *d++ = *s++;
  1051.       }
  1052.       *d = '\0';
  1053. --- 2039,2045 ----
  1054.           *d++ = *s++;
  1055.           if (*s == '+' || *s == '-')
  1056.           *d++ = *s++;
  1057. !         while (isDIGIT(*s))
  1058.           *d++ = *s++;
  1059.       }
  1060.       *d = '\0';
  1061. ***************
  1062. *** 2034,2040 ****
  1063.               s++, term = '\'';
  1064.           else
  1065.               term = '"';
  1066. !         while (isascii(*s) && (isalpha(*s) || isdigit(*s) || *s == '_'))
  1067.               *d++ = *s++;
  1068.           }                /* assuming tokenbuf won't clobber */
  1069.           *d++ = '\n';
  1070. --- 2070,2076 ----
  1071.               s++, term = '\'';
  1072.           else
  1073.               term = '"';
  1074. !         while (isALNUM(*s))
  1075.               *d++ = *s++;
  1076.           }                /* assuming tokenbuf won't clobber */
  1077.           *d++ = '\n';
  1078. ***************
  1079. *** 2057,2064 ****
  1080.       if (s < bufend)
  1081.           s++;
  1082.       if (*d == '$') d++;
  1083. !     while (*d &&
  1084. !       (isalpha(*d) || isdigit(*d) || *d == '_' || *d == '\''))
  1085.           d++;
  1086.       if (d - tokenbuf != len) {
  1087.           d = tokenbuf;
  1088. --- 2093,2099 ----
  1089.       if (s < bufend)
  1090.           s++;
  1091.       if (*d == '$') d++;
  1092. !     while (*d && (isALNUM(*d) || *d == '\''))
  1093.           d++;
  1094.       if (d - tokenbuf != len) {
  1095.           d = tokenbuf;
  1096. ***************
  1097. *** 2209,2215 ****
  1098.           s = tmpstr->str_ptr;
  1099.           send = s + tmpstr->str_cur;
  1100.           while (s < send) {        /* see if we can make SINGLE */
  1101. !         if (*s == '\\' && s[1] && isdigit(s[1]) && !isdigit(s[2]) &&
  1102.             !alwaysdollar && s[1] != '0')
  1103.               *s = '$';        /* grandfather \digit in subst */
  1104.           if ((*s == '$' || *s == '@') && s+1 < send &&
  1105. --- 2244,2250 ----
  1106.           s = tmpstr->str_ptr;
  1107.           send = s + tmpstr->str_cur;
  1108.           while (s < send) {        /* see if we can make SINGLE */
  1109. !         if (*s == '\\' && s[1] && isDIGIT(s[1]) && !isDIGIT(s[2]) &&
  1110.             !alwaysdollar && s[1] != '0')
  1111.               *s = '$';        /* grandfather \digit in subst */
  1112.           if ((*s == '$' || *s == '@') && s+1 < send &&
  1113. ***************
  1114. *** 2228,2233 ****
  1115. --- 2263,2270 ----
  1116.           if ((*s == '$' && s+1 < send &&
  1117.               (alwaysdollar || /*(*/ (s[1] != ')' && s[1] != '|')) ) ||
  1118.               (*s == '@' && s+1 < send) ) {
  1119. +             if (s[1] == '#' && (isALPHA(s[2]) || s[2] == '_'))
  1120. +             *d++ = *s++;
  1121.               len = scanident(s,send,tokenbuf) - s;
  1122.               if (*s == '$' || strEQ(tokenbuf,"ARGV")
  1123.                 || strEQ(tokenbuf,"ENV")
  1124. ***************
  1125. *** 2258,2264 ****
  1126.               case 'c':
  1127.               s++;
  1128.               *d = *s++;
  1129. !             if (islower(*d))
  1130.                   *d = toupper(*d);
  1131.               *d++ ^= 64;
  1132.               continue;
  1133. --- 2295,2301 ----
  1134.               case 'c':
  1135.               s++;
  1136.               *d = *s++;
  1137. !             if (isLOWER(*d))
  1138.                   *d = toupper(*d);
  1139.               *d++ ^= 64;
  1140.               continue;
  1141. ***************
  1142. *** 2337,2342 ****
  1143. --- 2374,2380 ----
  1144.           astore(stab_xarray(curcmd->c_filestab), (int)curcmd->c_line,tmpstr);
  1145.       }
  1146.       if (*s == '.') {
  1147. +         /*SUPPRESS 530*/
  1148.           for (t = s+1; *t == ' ' || *t == '\t'; t++) ;
  1149.           if (*t == '\n') {
  1150.           bufptr = s;
  1151. ***************
  1152. *** 2479,2485 ****
  1153.           }
  1154.           else {
  1155.           eol[-1] = '\n';
  1156. !         while (s < eol && isspace(*s))
  1157.               s++;
  1158.           t = s;
  1159.           while (s < eol) {
  1160. --- 2517,2523 ----
  1161.           }
  1162.           else {
  1163.           eol[-1] = '\n';
  1164. !         while (s < eol && isSPACE(*s))
  1165.               s++;
  1166.           t = s;
  1167.           while (s < eol) {
  1168. ***************
  1169. *** 2487,2493 ****
  1170.               case ' ': case '\t': case '\n': case ';':
  1171.               str_ncat(str, t, s - t);
  1172.               str_ncat(str, "," ,1);
  1173. !             while (s < eol && (isspace(*s) || *s == ';'))
  1174.                   s++;
  1175.               t = s;
  1176.               break;
  1177. --- 2525,2531 ----
  1178.               case ' ': case '\t': case '\n': case ';':
  1179.               str_ncat(str, t, s - t);
  1180.               str_ncat(str, "," ,1);
  1181. !             while (s < eol && (isSPACE(*s) || *s == ';'))
  1182.                   s++;
  1183.               t = s;
  1184.               break;
  1185.  
  1186. Index: hints/ultrix_4.sh
  1187. *** hints/ultrix_4.sh.old    Tue Nov  5 19:26:44 1991
  1188. --- hints/ultrix_4.sh    Tue Nov  5 19:26:45 1991
  1189. ***************
  1190. *** 6,11 ****
  1191. --- 6,14 ----
  1192.   may cause utime() to work incorrectly.  If so, regression test io/fs
  1193.   may fail if run under NFS.  Ignore the failure.
  1194.   EOF
  1195. +     case "$tmp" in
  1196. +     *4.2*) d_volatile=undef;;
  1197. +     esac
  1198.   ;;
  1199.   esac
  1200.   case "$tmp" in
  1201.  
  1202. Index: usub/usersub.c
  1203. Prereq: 4.0
  1204. *** usub/usersub.c.old    Tue Nov  5 19:28:24 1991
  1205. --- usub/usersub.c    Tue Nov  5 19:28:25 1991
  1206. ***************
  1207. *** 1,6 ****
  1208. ! /* $Header: usersub.c,v 4.0 91/03/20 01:56:34 lwall Locked $
  1209.    *
  1210.    * $Log:    usersub.c,v $
  1211.    * Revision 4.0  91/03/20  01:56:34  lwall
  1212.    * 4.0 baseline.
  1213.    * 
  1214. --- 1,9 ----
  1215. ! /* $RCSfile: usersub.c,v $$Revision: 4.0.1.1 $$Date: 91/11/05 19:07:24 $
  1216.    *
  1217.    * $Log:    usersub.c,v $
  1218. +  * Revision 4.0.1.1  91/11/05  19:07:24  lwall
  1219. +  * patch11: there are now subroutines for calling back from C into Perl
  1220. +  * 
  1221.    * Revision 4.0  91/03/20  01:56:34  lwall
  1222.    * 4.0 baseline.
  1223.    * 
  1224. ***************
  1225. *** 18,20 ****
  1226. --- 21,72 ----
  1227.       init_curses();
  1228.   }
  1229.   
  1230. + /* Be sure to refetch the stack pointer after calling these routines. */
  1231. + int
  1232. + callback(subname, sp, gimme, hasargs, numargs)
  1233. + char *subname;
  1234. + int sp;            /* stack pointer after args are pushed */
  1235. + int gimme;        /* called in array or scalar context */
  1236. + int hasargs;        /* whether to create a @_ array for routine */
  1237. + int numargs;        /* how many args are pushed on the stack */
  1238. + {
  1239. +     static ARG myarg[3];    /* fake syntax tree node */
  1240. +     int arglast[3];
  1241. +     
  1242. +     arglast[2] = sp;
  1243. +     sp -= numargs;
  1244. +     arglast[1] = sp--;
  1245. +     arglast[0] = sp;
  1246. +     if (!myarg[0].arg_ptr.arg_str)
  1247. +     myarg[0].arg_ptr.arg_str = str_make("",0);
  1248. +     myarg[1].arg_type = A_WORD;
  1249. +     myarg[1].arg_ptr.arg_stab = stabent(subname, FALSE);
  1250. +     myarg[2].arg_type = hasargs ? A_EXPR : A_NULL;
  1251. +     return do_subr(myarg, gimme, arglast);
  1252. + }
  1253. + int
  1254. + callv(subname, sp, gimme, argv)
  1255. + char *subname;
  1256. + register int sp;    /* current stack pointer */
  1257. + int gimme;        /* called in array or scalar context */
  1258. + register char **argv;    /* null terminated arg list, NULL for no arglist */
  1259. + {
  1260. +     register int items = 0;
  1261. +     int hasargs = (argv != 0);
  1262. +     astore(stack, ++sp, Nullstr);    /* reserve spot for 1st return arg */
  1263. +     if (hasargs) {
  1264. +     while (*argv) {
  1265. +         astore(stack, ++sp, str_2mortal(str_make(*argv,0)));
  1266. +         items++;
  1267. +         argv++;
  1268. +     }
  1269. +     }
  1270. +     return callback(subname, sp, gimme, hasargs, items);
  1271. + }
  1272.  
  1273. Index: util.c
  1274. *** util.c.old    Tue Nov  5 19:28:27 1991
  1275. --- util.c    Tue Nov  5 19:28:28 1991
  1276. ***************
  1277. *** 1,4 ****
  1278. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 12:10:42 $
  1279.    *
  1280.    *    Copyright (c) 1991, Larry Wall
  1281.    *
  1282. --- 1,4 ----
  1283. ! /* $RCSfile: util.c,v $$Revision: 4.0.1.3 $$Date: 91/11/05 19:18:26 $
  1284.    *
  1285.    *    Copyright (c) 1991, Larry Wall
  1286.    *
  1287. ***************
  1288. *** 6,11 ****
  1289. --- 6,17 ----
  1290.    *    License or the Artistic License, as specified in the README file.
  1291.    *
  1292.    * $Log:    util.c,v $
  1293. +  * Revision 4.0.1.3  91/11/05  19:18:26  lwall
  1294. +  * patch11: safe malloc code now integrated into Perl's malloc when possible
  1295. +  * patch11: index("little", "longer string") could visit faraway places
  1296. +  * patch11: warn '-' x 10000 dumped core
  1297. +  * patch11: forked exec on non-existent program now issues a warning
  1298. +  * 
  1299.    * Revision 4.0.1.2  91/06/07  12:10:42  lwall
  1300.    * patch4: new copyright notice
  1301.    * patch4: made some allowances for "semi-standard" C
  1302. ***************
  1303. *** 20,25 ****
  1304. --- 26,32 ----
  1305.    * 4.0 baseline.
  1306.    * 
  1307.    */
  1308. + /*SUPPRESS 112*/
  1309.   
  1310.   #include "EXTERN.h"
  1311.   #include "perl.h"
  1312. ***************
  1313. *** 45,50 ****
  1314. --- 52,59 ----
  1315.   
  1316.   #define FLUSH
  1317.   
  1318. + #ifndef safemalloc
  1319.   static char nomem[] = "Out of memory!\n";
  1320.   
  1321.   /* paranoid version of malloc */
  1322. ***************
  1323. *** 173,182 ****
  1324. --- 182,194 ----
  1325.   #  endif
  1326.   #endif
  1327.       if (where) {
  1328. +     /*SUPPRESS 701*/
  1329.       free(where);
  1330.       }
  1331.   }
  1332.   
  1333. + #endif /* !safemalloc */
  1334.   #ifdef LEAKTEST
  1335.   
  1336.   #define ALIGN sizeof(long)
  1337. ***************
  1338. *** 222,228 ****
  1339.       register int i;
  1340.   
  1341.       for (i = 0; i < MAXXCOUNT; i++) {
  1342. !     if (xcount[i] != lastxcount[i]) {
  1343.           fprintf(stderr,"%2d %2d\t%ld\n", i / 100, i % 100, xcount[i]);
  1344.           lastxcount[i] = xcount[i];
  1345.       }
  1346. --- 234,240 ----
  1347.       register int i;
  1348.   
  1349.       for (i = 0; i < MAXXCOUNT; i++) {
  1350. !     if (xcount[i] > lastxcount[i]) {
  1351.           fprintf(stderr,"%2d %2d\t%ld\n", i / 100, i % 100, xcount[i]);
  1352.           lastxcount[i] = xcount[i];
  1353.       }
  1354. ***************
  1355. *** 307,312 ****
  1356. --- 319,326 ----
  1357.   
  1358.       if (!first && little > littleend)
  1359.       return big;
  1360. +     if (bigend - big < littleend - little)
  1361. +     return Nullch;
  1362.       bigend -= littleend - little++;
  1363.       while (big <= bigend) {
  1364.       if (*big++ != first)
  1365. ***************
  1366. *** 433,440 ****
  1367.   {
  1368.       register unsigned char *s;
  1369.       register unsigned char *table;
  1370. !     register int i;
  1371. !     register int len = str->str_cur;
  1372.       int rarest = 0;
  1373.       unsigned int frequency = 256;
  1374.   
  1375. --- 447,454 ----
  1376.   {
  1377.       register unsigned char *s;
  1378.       register unsigned char *table;
  1379. !     register unsigned int i;
  1380. !     register unsigned int len = str->str_cur;
  1381.       int rarest = 0;
  1382.       unsigned int frequency = 256;
  1383.   
  1384. ***************
  1385. *** 564,569 ****
  1386. --- 578,584 ----
  1387.       if (littlestr->str_pok & SP_CASEFOLD) {    /* case insensitive? */
  1388.       if (s < bigend) {
  1389.         top1:
  1390. +         /*SUPPRESS 560*/
  1391.           if (tmp = table[*s]) {
  1392.   #ifdef POINTERRIGOR
  1393.           if (bigend - s > tmp) {
  1394. ***************
  1395. *** 597,602 ****
  1396. --- 612,618 ----
  1397.       else {
  1398.       if (s < bigend) {
  1399.         top2:
  1400. +         /*SUPPRESS 560*/
  1401.           if (tmp = table[*s]) {
  1402.   #ifdef POINTERRIGOR
  1403.           if (bigend - s > tmp) {
  1404. ***************
  1405. *** 660,666 ****
  1406.       big = Null(unsigned char*);
  1407.   #endif
  1408.       bigend = big + bigstr->str_cur;
  1409. -     big -= previous;
  1410.       while (pos < previous) {
  1411.   #ifndef lint
  1412.       if (!(pos += screamnext[pos]))
  1413. --- 676,681 ----
  1414. ***************
  1415. *** 667,676 ****
  1416.   #endif
  1417.           return Nullch;
  1418.       }
  1419.       if (littlestr->str_pok & SP_CASEFOLD) {    /* case insignificant? */
  1420.       do {
  1421. !         if (big[pos] != first && big[pos] != fold[first])
  1422. !         continue;
  1423.           for (x=big+pos+1,s=little; s < littleend; /**/ ) {
  1424.           if (x >= bigend)
  1425.               return Nullch;
  1426. --- 682,757 ----
  1427.   #endif
  1428.           return Nullch;
  1429.       }
  1430. + #ifdef POINTERRIGOR
  1431.       if (littlestr->str_pok & SP_CASEFOLD) {    /* case insignificant? */
  1432.       do {
  1433. ! #ifndef lint
  1434. !         while (big[pos-previous] != first && big[pos-previous] != fold[first]
  1435. !           && (pos += screamnext[pos]) )
  1436. !         /*SUPPRESS 530*/
  1437. !         ;
  1438. ! #endif
  1439. !         for (x=big+pos+1-previous,s=little; s < littleend; /**/ ) {
  1440. !         if (x >= bigend)
  1441. !             return Nullch;
  1442. !         if (*s++ != *x++ && fold[*(s-1)] != *(x-1)) {
  1443. !             s--;
  1444. !             break;
  1445. !         }
  1446. !         }
  1447. !         if (s == littleend)
  1448. ! #ifndef lint
  1449. !         return (char *)(big+pos-previous);
  1450. ! #else
  1451. !         return Nullch;
  1452. ! #endif
  1453. !     } while (
  1454. ! #ifndef lint
  1455. !         pos += screamnext[pos]    /* does this goof up anywhere? */
  1456. ! #else
  1457. !         pos += screamnext[0]
  1458. ! #endif
  1459. !         );
  1460. !     }
  1461. !     else {
  1462. !     do {
  1463. ! #ifndef lint
  1464. !         while (big[pos-previous] != first && (pos += screamnext[pos]))
  1465. !         /*SUPPRESS 530*/
  1466. !         ;
  1467. ! #endif
  1468. !         for (x=big+pos+1-previous,s=little; s < littleend; /**/ ) {
  1469. !         if (x >= bigend)
  1470. !             return Nullch;
  1471. !         if (*s++ != *x++) {
  1472. !             s--;
  1473. !             break;
  1474. !         }
  1475. !         }
  1476. !         if (s == littleend)
  1477. ! #ifndef lint
  1478. !         return (char *)(big+pos-previous);
  1479. ! #else
  1480. !         return Nullch;
  1481. ! #endif
  1482. !     } while (
  1483. ! #ifndef lint
  1484. !         pos += screamnext[pos]
  1485. ! #else
  1486. !         pos += screamnext[0]
  1487. ! #endif
  1488. !         );
  1489. !     }
  1490. ! #else /* !POINTERRIGOR */
  1491. !     big -= previous;
  1492. !     if (littlestr->str_pok & SP_CASEFOLD) {    /* case insignificant? */
  1493. !     do {
  1494. ! #ifndef lint
  1495. !         while (big[pos] != first && big[pos] != fold[first]
  1496. !           && (pos += screamnext[pos]) )
  1497. !         /*SUPPRESS 530*/
  1498. !         ;
  1499. ! #endif
  1500.           for (x=big+pos+1,s=little; s < littleend; /**/ ) {
  1501.           if (x >= bigend)
  1502.               return Nullch;
  1503. ***************
  1504. *** 695,702 ****
  1505.       }
  1506.       else {
  1507.       do {
  1508. !         if (big[pos] != first)
  1509. !         continue;
  1510.           for (x=big+pos+1,s=little; s < littleend; /**/ ) {
  1511.           if (x >= bigend)
  1512.               return Nullch;
  1513. --- 776,786 ----
  1514.       }
  1515.       else {
  1516.       do {
  1517. ! #ifndef lint
  1518. !         while (big[pos] != first && (pos += screamnext[pos]))
  1519. !         /*SUPPRESS 530*/
  1520. !         ;
  1521. ! #endif
  1522.           for (x=big+pos+1,s=little; s < littleend; /**/ ) {
  1523.           if (x >= bigend)
  1524.               return Nullch;
  1525. ***************
  1526. *** 719,724 ****
  1527. --- 803,809 ----
  1528.   #endif
  1529.           );
  1530.       }
  1531. + #endif /* POINTERRIGOR */
  1532.       return Nullch;
  1533.   }
  1534.   
  1535. ***************
  1536. *** 774,783 ****
  1537.   long a1, a2, a3, a4;
  1538.   {
  1539.       char *s;
  1540.   
  1541.       s = buf;
  1542. !     (void)sprintf(s,pat,a1,a2,a3,a4);
  1543. !     s += strlen(s);
  1544.       if (s[-1] != '\n') {
  1545.       if (curcmd->c_line) {
  1546.           (void)sprintf(s," at %s line %ld",
  1547. --- 859,878 ----
  1548.   long a1, a2, a3, a4;
  1549.   {
  1550.       char *s;
  1551. +     int usermess = strEQ(pat,"%s");
  1552. +     STR *tmpstr;
  1553.   
  1554.       s = buf;
  1555. !     if (usermess) {
  1556. !     tmpstr = str_mortal(&str_undef);
  1557. !     str_set(tmpstr, (char*)a1);
  1558. !     *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
  1559. !     }
  1560. !     else {
  1561. !     (void)sprintf(s,pat,a1,a2,a3,a4);
  1562. !     s += strlen(s);
  1563. !     }
  1564.       if (s[-1] != '\n') {
  1565.       if (curcmd->c_line) {
  1566.           (void)sprintf(s," at %s line %ld",
  1567. ***************
  1568. *** 793,799 ****
  1569. --- 888,900 ----
  1570.           s += strlen(s);
  1571.       }
  1572.       (void)strcpy(s,".\n");
  1573. +     if (usermess)
  1574. +         str_cat(tmpstr,buf+1);
  1575.       }
  1576. +     if (usermess)
  1577. +     return tmpstr->str_ptr;
  1578. +     else
  1579. +     return buf;
  1580.   }
  1581.   
  1582.   /*VARARGS1*/
  1583. ***************
  1584. *** 804,813 ****
  1585.       extern FILE *e_fp;
  1586.       extern char *e_tmpname;
  1587.       char *tmps;
  1588.   
  1589. !     mess(pat,a1,a2,a3,a4);
  1590.       if (in_eval) {
  1591. !     str_set(stab_val(stabent("@",TRUE)),buf);
  1592.       tmps = "_EVAL_";
  1593.       while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
  1594.         strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
  1595. --- 905,915 ----
  1596.       extern FILE *e_fp;
  1597.       extern char *e_tmpname;
  1598.       char *tmps;
  1599. +     char *message;
  1600.   
  1601. !     message = mess(pat,a1,a2,a3,a4);
  1602.       if (in_eval) {
  1603. !     str_set(stab_val(stabent("@",TRUE)),message);
  1604.       tmps = "_EVAL_";
  1605.       while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
  1606.         strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
  1607. ***************
  1608. *** 831,837 ****
  1609.       }
  1610.       longjmp(loop_stack[loop_ptr].loop_env, 1);
  1611.       }
  1612. !     fputs(buf,stderr);
  1613.       (void)fflush(stderr);
  1614.       if (e_fp)
  1615.       (void)UNLINK(e_tmpname);
  1616. --- 933,939 ----
  1617.       }
  1618.       longjmp(loop_stack[loop_ptr].loop_env, 1);
  1619.       }
  1620. !     fputs(message,stderr);
  1621.       (void)fflush(stderr);
  1622.       if (e_fp)
  1623.       (void)UNLINK(e_tmpname);
  1624. ***************
  1625. *** 844,851 ****
  1626.   char *pat;
  1627.   long a1, a2, a3, a4;
  1628.   {
  1629. !     mess(pat,a1,a2,a3,a4);
  1630. !     fputs(buf,stderr);
  1631.   #ifdef LEAKTEST
  1632.   #ifdef DEBUGGING
  1633.       if (debug & 4096)
  1634. --- 946,955 ----
  1635.   char *pat;
  1636.   long a1, a2, a3, a4;
  1637.   {
  1638. !     char *message;
  1639. !     message = mess(pat,a1,a2,a3,a4);
  1640. !     fputs(message,stderr);
  1641.   #ifdef LEAKTEST
  1642.   #ifdef DEBUGGING
  1643.       if (debug & 4096)
  1644. ***************
  1645. *** 856,866 ****
  1646. --- 960,973 ----
  1647.   }
  1648.   #else
  1649.   /*VARARGS0*/
  1650. + char *
  1651.   mess(args)
  1652.   va_list args;
  1653.   {
  1654.       char *pat;
  1655.       char *s;
  1656. +     STR *tmpstr;
  1657. +     int usermess;
  1658.   #ifndef HAS_VPRINTF
  1659.   #ifdef CHARVSPRINTF
  1660.       char *vsprintf();
  1661. ***************
  1662. *** 869,883 ****
  1663.   #endif
  1664.   #endif
  1665.   
  1666. -     s = buf;
  1667.   #ifdef lint
  1668.       pat = Nullch;
  1669.   #else
  1670.       pat = va_arg(args, char *);
  1671.   #endif
  1672. !     (void) vsprintf(s,pat,args);
  1673.   
  1674. -     s += strlen(s);
  1675.       if (s[-1] != '\n') {
  1676.       if (curcmd->c_line) {
  1677.           (void)sprintf(s," at %s line %ld",
  1678. --- 976,998 ----
  1679.   #endif
  1680.   #endif
  1681.   
  1682.   #ifdef lint
  1683.       pat = Nullch;
  1684.   #else
  1685.       pat = va_arg(args, char *);
  1686.   #endif
  1687. !     s = buf;
  1688. !     usermess = strEQ(pat, "%s");
  1689. !     if (usermess) {
  1690. !     tmpstr = str_mortal(&str_undef);
  1691. !     str_set(tmpstr, va_arg(args, char *));
  1692. !     *s++ = tmpstr->str_ptr[tmpstr->str_cur-1];
  1693. !     }
  1694. !     else {
  1695. !     (void) vsprintf(s,pat,args);
  1696. !     s += strlen(s);
  1697. !     }
  1698.   
  1699.       if (s[-1] != '\n') {
  1700.       if (curcmd->c_line) {
  1701.           (void)sprintf(s," at %s line %ld",
  1702. ***************
  1703. *** 893,899 ****
  1704. --- 1008,1021 ----
  1705.           s += strlen(s);
  1706.       }
  1707.       (void)strcpy(s,".\n");
  1708. +     if (usermess)
  1709. +         str_cat(tmpstr,buf+1);
  1710.       }
  1711. +     if (usermess)
  1712. +     return tmpstr->str_ptr;
  1713. +     else
  1714. +     return buf;
  1715.   }
  1716.   
  1717.   /*VARARGS0*/
  1718. ***************
  1719. *** 904,909 ****
  1720. --- 1026,1032 ----
  1721.       extern FILE *e_fp;
  1722.       extern char *e_tmpname;
  1723.       char *tmps;
  1724. +     char *message;
  1725.   
  1726.   #ifndef lint
  1727.       va_start(args);
  1728. ***************
  1729. *** 910,919 ****
  1730.   #else
  1731.       args = 0;
  1732.   #endif
  1733. !     mess(args);
  1734.       va_end(args);
  1735.       if (in_eval) {
  1736. !     str_set(stab_val(stabent("@",TRUE)),buf);
  1737.       tmps = "_EVAL_";
  1738.       while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
  1739.         strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
  1740. --- 1033,1042 ----
  1741.   #else
  1742.       args = 0;
  1743.   #endif
  1744. !     message = mess(args);
  1745.       va_end(args);
  1746.       if (in_eval) {
  1747. !     str_set(stab_val(stabent("@",TRUE)),message);
  1748.       tmps = "_EVAL_";
  1749.       while (loop_ptr >= 0 && (!loop_stack[loop_ptr].loop_label ||
  1750.         strNE(tmps,loop_stack[loop_ptr].loop_label) )) {
  1751. ***************
  1752. *** 937,943 ****
  1753.       }
  1754.       longjmp(loop_stack[loop_ptr].loop_env, 1);
  1755.       }
  1756. !     fputs(buf,stderr);
  1757.       (void)fflush(stderr);
  1758.       if (e_fp)
  1759.       (void)UNLINK(e_tmpname);
  1760. --- 1060,1066 ----
  1761.       }
  1762.       longjmp(loop_stack[loop_ptr].loop_env, 1);
  1763.       }
  1764. !     fputs(message,stderr);
  1765.       (void)fflush(stderr);
  1766.       if (e_fp)
  1767.       (void)UNLINK(e_tmpname);
  1768. ***************
  1769. *** 950,955 ****
  1770. --- 1073,1079 ----
  1771.   va_dcl
  1772.   {
  1773.       va_list args;
  1774. +     char *message;
  1775.   
  1776.   #ifndef lint
  1777.       va_start(args);
  1778. ***************
  1779. *** 956,965 ****
  1780.   #else
  1781.       args = 0;
  1782.   #endif
  1783. !     mess(args);
  1784.       va_end(args);
  1785.   
  1786. !     fputs(buf,stderr);
  1787.   #ifdef LEAKTEST
  1788.   #ifdef DEBUGGING
  1789.       if (debug & 4096)
  1790. --- 1080,1089 ----
  1791.   #else
  1792.       args = 0;
  1793.   #endif
  1794. !     message = mess(args);
  1795.       va_end(args);
  1796.   
  1797. !     fputs(message,stderr);
  1798.   #ifdef LEAKTEST
  1799.   #ifdef DEBUGGING
  1800.       if (debug & 4096)
  1801. ***************
  1802. *** 981,986 ****
  1803. --- 1105,1111 ----
  1804.       int max;
  1805.       char **tmpenv;
  1806.   
  1807. +     /*SUPPRESS 530*/
  1808.       for (max = i; environ[max]; max++) ;
  1809.       New(901,tmpenv, max+2, char*);
  1810.       for (j=0; j<max; j++)        /* copy environment */
  1811. ***************
  1812. *** 1242,1249 ****
  1813. --- 1367,1376 ----
  1814.           close(fd);
  1815.   #endif
  1816.           do_exec(cmd);    /* may or may not use the shell */
  1817. +         warn("Can't exec \"%s\": %s", cmd, strerror(errno));
  1818.           _exit(1);
  1819.       }
  1820. +     /*SUPPRESS 560*/
  1821.       if (tmpstab = stabent("$",allstabs))
  1822.           str_numset(STAB_STR(tmpstab),(double)getpid());
  1823.       forkprocess = 0;
  1824. ***************
  1825. *** 1321,1329 ****
  1826.       int pid;
  1827.   
  1828.       str = afetch(fdpid,fileno(ptr),TRUE);
  1829.       astore(fdpid,fileno(ptr),Nullstr);
  1830.       fclose(ptr);
  1831. -     pid = (int)str->str_u.str_useful;
  1832.       hstat = signal(SIGHUP, SIG_IGN);
  1833.       istat = signal(SIGINT, SIG_IGN);
  1834.       qstat = signal(SIGQUIT, SIG_IGN);
  1835. --- 1448,1456 ----
  1836.       int pid;
  1837.   
  1838.       str = afetch(fdpid,fileno(ptr),TRUE);
  1839. +     pid = (int)str->str_u.str_useful;
  1840.       astore(fdpid,fileno(ptr),Nullstr);
  1841.       fclose(ptr);
  1842.       hstat = signal(SIGHUP, SIG_IGN);
  1843.       istat = signal(SIGINT, SIG_IGN);
  1844.       qstat = signal(SIGQUIT, SIG_IGN);
  1845. ***************
  1846. *** 1340,1348 ****
  1847. --- 1467,1477 ----
  1848.   int *statusp;
  1849.   int flags;
  1850.   {
  1851. + #if !defined(HAS_WAIT4) && !defined(HAS_WAITPID)
  1852.       int result;
  1853.       STR *str;
  1854.       char spid[16];
  1855. + #endif
  1856.   
  1857.       if (!pid)
  1858.       return -1;
  1859. ***************
  1860. *** 1387,1392 ****
  1861. --- 1516,1522 ----
  1862.   #endif
  1863.   }
  1864.   
  1865. + /*SUPPRESS 590*/
  1866.   pidgone(pid,status)
  1867.   int pid;
  1868.   int status;
  1869.  
  1870. Index: util.h
  1871. *** util.h.old    Tue Nov  5 19:28:31 1991
  1872. --- util.h    Tue Nov  5 19:28:31 1991
  1873. ***************
  1874. *** 1,4 ****
  1875. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:11:00 $
  1876.    *
  1877.    *    Copyright (c) 1991, Larry Wall
  1878.    *
  1879. --- 1,4 ----
  1880. ! /* $RCSfile: util.h,v $$Revision: 4.0.1.2 $$Date: 91/11/05 19:18:40 $
  1881.    *
  1882.    *    Copyright (c) 1991, Larry Wall
  1883.    *
  1884. ***************
  1885. *** 6,11 ****
  1886. --- 6,14 ----
  1887.    *    License or the Artistic License, as specified in the README file.
  1888.    *
  1889.    * $Log:    util.h,v $
  1890. +  * Revision 4.0.1.2  91/11/05  19:18:40  lwall
  1891. +  * patch11: safe malloc code now integrated into Perl's malloc when possible
  1892. +  * 
  1893.    * Revision 4.0.1.1  91/06/07  12:11:00  lwall
  1894.    * patch4: new copyright notice
  1895.    * 
  1896. ***************
  1897. *** 17,24 ****
  1898. --- 20,29 ----
  1899.   EXT int *screamfirst INIT(Null(int*));
  1900.   EXT int *screamnext INIT(Null(int*));
  1901.   
  1902. + #ifndef safemalloc
  1903.   char    *safemalloc();
  1904.   char    *saferealloc();
  1905. + #endif
  1906.   char    *cpytill();
  1907.   char    *instr();
  1908.   char    *fbminstr();
  1909.  
  1910. *** End of Patch 17 ***
  1911. exit 0 # Just in case...
  1912. -- 
  1913. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1914. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1915. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1916. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1917.