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

  1. Newsgroups: comp.sources.misc
  2. From: lwall@netlabs.com (Larry Wall)
  3. Subject:  v25i065:  perl - The perl programming language, Patch16
  4. Message-ID: <1991Nov13.214519.3898@sparky.imd.sterling.com>
  5. X-Md4-Signature: 804831971202fcf3ea912a072808a5da
  6. Date: Wed, 13 Nov 1991 21:45:19 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: lwall@netlabs.com (Larry Wall)
  10. Posting-number: Volume 25, Issue 65
  11. Archive-name: perl/patch16
  12. Environment: UNIX, MS-DOS, OS2
  13. Patch-To: perl: Volume 18, Issue 19-54
  14.  
  15. System: perl version 4.0
  16. Patch #: 16
  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: 15
  56. 1c1
  57. < #define PATCHLEVEL 15
  58. ---
  59. > #define PATCHLEVEL 16
  60.  
  61. Index: lib/perldb.pl
  62. Prereq: 4.0.1.1
  63. *** lib/perldb.pl.old    Tue Nov  5 19:27:07 1991
  64. --- lib/perldb.pl    Tue Nov  5 19:27:08 1991
  65. ***************
  66. *** 1,6 ****
  67.   package DB;
  68.   
  69. ! $header = '$RCSfile: perldb.pl,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:17:44 $';
  70.   #
  71.   # This file is automatically included if you do perl -d.
  72.   # It's probably not useful to include this yourself.
  73. --- 1,10 ----
  74.   package DB;
  75.   
  76. ! # modified Perl debugger, to be run from Emacs in perldb-mode
  77. ! # Ray Lischner (uunet!mntgfx!lisch) as of 5 Nov 1990
  78. ! # Johan Vromans -- upgrade to 4.0 pl 10
  79. ! $header = '$RCSfile: perldb.pl,v $$Revision: 4.0.1.2 $$Date: 91/11/05 17:55:58 $';
  80.   #
  81.   # This file is automatically included if you do perl -d.
  82.   # It's probably not useful to include this yourself.
  83. ***************
  84. *** 10,15 ****
  85. --- 14,22 ----
  86.   # have a breakpoint.  It also inserts a do 'perldb.pl' before the first line.
  87.   #
  88.   # $Log:    perldb.pl,v $
  89. + # Revision 4.0.1.2  91/11/05  17:55:58  lwall
  90. + # patch11: perldb.pl modified to run within emacs in perldb-mode
  91. + # 
  92.   # Revision 4.0.1.1  91/06/07  11:17:44  lwall
  93.   # patch4: added $^P variable to control calling of perldb routines
  94.   # patch4: debugger sometimes listed wrong number of lines for a statement
  95. ***************
  96. *** 57,64 ****
  97.   $| = 1;                # for real STDOUT
  98.   $sub = '';
  99.   
  100.   $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  101. ! print OUT "\nLoading DB routines from $header\n\nEnter h for help.\n\n";
  102.   
  103.   sub DB {
  104.       &save;
  105. --- 64,79 ----
  106.   $| = 1;                # for real STDOUT
  107.   $sub = '';
  108.   
  109. + # Is Perl being run from Emacs?
  110. + $emacs = $main'ARGV[$[] eq '-emacs';
  111. + shift(@main'ARGV) if $emacs;
  112.   $header =~ s/.Header: ([^,]+),v(\s+\S+\s+\S+).*$/$1$2/;
  113. ! print OUT "\nLoading DB routines from $header\n";
  114. ! print OUT ("Emacs support ",
  115. !        $emacs ? "enabled" : "available",
  116. !        ".\n");
  117. ! print OUT "\nEnter h for help.\n\n";
  118.   
  119.   sub DB {
  120.       &save;
  121. ***************
  122. *** 78,88 ****
  123.       }
  124.       }
  125.       if ($single || $trace || $signal) {
  126. !     print OUT "$package'" unless $sub =~ /'/;
  127. !     print OUT "$sub($filename:$line):\t",$dbline[$line];
  128. !     for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  129. !         last if $dbline[$i] =~ /^\s*(;|}|#|\n)/;
  130. !         print OUT "$sub($filename:$i):\t",$dbline[$i];
  131.       }
  132.       }
  133.       $evalarg = $action, &eval if $action;
  134. --- 93,107 ----
  135.       }
  136.       }
  137.       if ($single || $trace || $signal) {
  138. !     if ($emacs) {
  139. !         print OUT "\032\032$filename:$line:0\n";
  140. !     } else {
  141. !         print OUT "$package'" unless $sub =~ /'/;
  142. !         print OUT "$sub($filename:$line):\t",$dbline[$line];
  143. !         for ($i = $line + 1; $i <= $max && $dbline[$i] == 0; ++$i) {
  144. !         last if $dbline[$i] =~ /^\s*(}|#|\n)/;
  145. !         print OUT "$sub($filename:$i):\t",$dbline[$i];
  146. !         }
  147.       }
  148.       }
  149.       $evalarg = $action, &eval if $action;
  150. ***************
  151. *** 244,252 ****
  152.               $i = $2;
  153.               $i = $line if $i eq '.';
  154.               $i = 1 if $i < 1;
  155. !             for (; $i <= $end; $i++) {
  156. !             print OUT "$i:\t", $dbline[$i];
  157. !             last if $signal;
  158.               }
  159.               $start = $i;    # remember in case they want more
  160.               $start = $max if $start > $max;
  161. --- 263,276 ----
  162.               $i = $2;
  163.               $i = $line if $i eq '.';
  164.               $i = 1 if $i < 1;
  165. !             if ($emacs) {
  166. !             print OUT "\032\032$filename:$i:0\n";
  167. !             $i = $end;
  168. !             } else {
  169. !             for (; $i <= $end; $i++) {
  170. !                 print OUT "$i:\t", $dbline[$i];
  171. !                 last if $signal;
  172. !             }
  173.               }
  174.               $start = $i;    # remember in case they want more
  175.               $start = $max if $start > $max;
  176. ***************
  177. *** 393,399 ****
  178.               $start = 1 if ($start > $max);
  179.               last if ($start == $end);
  180.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  181. !                 print OUT "$start:\t", $dbline[$start], "\n";
  182.                   last;
  183.               }
  184.               } ';
  185. --- 417,427 ----
  186.               $start = 1 if ($start > $max);
  187.               last if ($start == $end);
  188.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  189. !                 if ($emacs) {
  190. !                 print OUT "\032\032$filename:$start:0\n";
  191. !                 } else {
  192. !                 print OUT "$start:\t", $dbline[$start], "\n";
  193. !                 }
  194.                   last;
  195.               }
  196.               } ';
  197. ***************
  198. *** 417,423 ****
  199.               $start = $max if ($start <= 0);
  200.               last if ($start == $end);
  201.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  202. !                 print OUT "$start:\t", $dbline[$start], "\n";
  203.                   last;
  204.               }
  205.               } ';
  206. --- 445,455 ----
  207.               $start = $max if ($start <= 0);
  208.               last if ($start == $end);
  209.               if ($dbline[$start] =~ m'."\n$pat\n".'i) {
  210. !                 if ($emacs) {
  211. !                 print OUT "\032\032$filename:$start:0\n";
  212. !                 } else {
  213. !                 print OUT "$start:\t", $dbline[$start], "\n";
  214. !                 }
  215.                   last;
  216.               }
  217.               } ';
  218.  
  219. Index: perly.y
  220. *** perly.y.old    Tue Nov  5 19:27:37 1991
  221. --- perly.y    Tue Nov  5 19:27:37 1991
  222. ***************
  223. *** 1,4 ****
  224. ! /* $RCSfile: perly.y,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:42:34 $
  225.    *
  226.    *    Copyright (c) 1991, Larry Wall
  227.    *
  228. --- 1,4 ----
  229. ! /* $RCSfile: perly.y,v $$Revision: 4.0.1.2 $$Date: 91/11/05 18:17:38 $
  230.    *
  231.    *    Copyright (c) 1991, Larry Wall
  232.    *
  233. ***************
  234. *** 6,11 ****
  235. --- 6,16 ----
  236.    *    License or the Artistic License, as specified in the README file.
  237.    *
  238.    * $Log:    perly.y,v $
  239. +  * Revision 4.0.1.2  91/11/05  18:17:38  lwall
  240. +  * patch11: extra comma at end of list is now allowed in more places (Hi, Felix!)
  241. +  * patch11: once-thru blocks didn't display right in the debugger
  242. +  * patch11: debugger got confused over nested subroutine definitions
  243. +  * 
  244.    * Revision 4.0.1.1  91/06/07  11:42:34  lwall
  245.    * patch4: new copyright notice
  246.    * 
  247. ***************
  248. *** 18,23 ****
  249. --- 23,32 ----
  250.   #include "INTERN.h"
  251.   #include "perl.h"
  252.   
  253. + /*SUPPRESS 530*/
  254. + /*SUPPRESS 593*/
  255. + /*SUPPRESS 595*/
  256.   STAB *scrstab;
  257.   ARG *arg4;    /* rarely used arguments to make_op() */
  258.   ARG *arg5;
  259. ***************
  260. *** 36,41 ****
  261. --- 45,52 ----
  262.       FCMD *formval;
  263.   }
  264.   
  265. + %token <ival> '{' ')'
  266.   %token <cval> WORD
  267.   %token <ival> APPEND OPEN SSELECT LOOPEX
  268.   %token <ival> USING FORMAT DO SHIFT PUSH POP LVALFUN
  269. ***************
  270. *** 49,55 ****
  271.   %token <arg> SUBST PATTERN
  272.   %token <arg> RSTRING TRANS
  273.   
  274. ! %type <ival> prog decl format remember
  275.   %type <cmdval> block lineseq line loop cond sideff nexpr else
  276.   %type <arg> expr sexpr cexpr csexpr term handle aryword hshword
  277.   %type <arg> texpr listop bareword
  278. --- 60,66 ----
  279.   %token <arg> SUBST PATTERN
  280.   %token <arg> RSTRING TRANS
  281.   
  282. ! %type <ival> prog decl format remember crp
  283.   %type <cmdval> block lineseq line loop cond sideff nexpr else
  284.   %type <arg> expr sexpr cexpr csexpr term handle aryword hshword
  285.   %type <arg> texpr listop bareword
  286. ***************
  287. *** 110,115 ****
  288. --- 121,128 ----
  289.   
  290.   block    :    '{' remember lineseq '}'
  291.               { $$ = block_head($3);
  292. +               if (cmdline > $1)
  293. +                   cmdline = $1;
  294.                 if (savestack->ary_fill > $2)
  295.                   restorelist($2); }
  296.       ;
  297. ***************
  298. *** 190,196 ****
  299.               { cmdline = $2;
  300.                   $$ = wopt(add_label($1,
  301.                   invert(make_ccmd(C_WHILE, cmd_to_arg($3),$4)) )); }
  302. !     |    label FOR REG '(' expr ')' compblock
  303.               { cmdline = $2;
  304.                   /*
  305.                    * The following gobbledygook catches EXPRs that
  306. --- 203,209 ----
  307.               { cmdline = $2;
  308.                   $$ = wopt(add_label($1,
  309.                   invert(make_ccmd(C_WHILE, cmd_to_arg($3),$4)) )); }
  310. !     |    label FOR REG '(' expr crp compblock
  311.               { cmdline = $2;
  312.                   /*
  313.                    * The following gobbledygook catches EXPRs that
  314. ***************
  315. *** 229,235 ****
  316.                   make_ccmd(C_WHILE,$5,$7) )));
  317.                   }
  318.               }
  319. !     |    label FOR '(' expr ')' compblock
  320.               { cmdline = $2;
  321.                   if ($4->arg_type != O_ARRAY) {
  322.                   scrstab = aadd(genstab());
  323. --- 242,248 ----
  324.                   make_ccmd(C_WHILE,$5,$7) )));
  325.                   }
  326.               }
  327. !     |    label FOR '(' expr crp compblock
  328.               { cmdline = $2;
  329.                   if ($4->arg_type != O_ARRAY) {
  330.                   scrstab = aadd(genstab());
  331. ***************
  332. *** 303,309 ****
  333.       ;
  334.   
  335.   subrout    :    SUB WORD block
  336. !             { make_sub($2,$3); }
  337.       ;
  338.   
  339.   package :    PACKAGE WORD ';'
  340. --- 316,325 ----
  341.       ;
  342.   
  343.   subrout    :    SUB WORD block
  344. !             { make_sub($2,$3);
  345. !               cmdline = NOLINE;
  346. !               if (savestack->ary_fill > $1)
  347. !                 restorelist($1); }
  348.       ;
  349.   
  350.   package :    PACKAGE WORD ';'
  351. ***************
  352. *** 443,456 ****
  353.                   stab2arg(A_STAB,
  354.                     $1 == O_FTTTY?stabent("STDIN",TRUE):defstab),
  355.                   Nullarg, Nullarg); }
  356. !     |    LOCAL '(' expr ')'
  357.               { $$ = l(localize(make_op(O_ASSIGN, 1,
  358.                   localize(listish(make_list($3))),
  359.                   Nullarg,Nullarg))); }
  360. !     |    '(' expr ',' ')'
  361.               { $$ = make_list($2); }
  362. -     |    '(' expr ')'
  363. -             { $$ = make_list($2); }
  364.       |    '(' ')'
  365.               { $$ = make_list(Nullarg); }
  366.       |    DO sexpr    %prec FILETEST
  367. --- 459,470 ----
  368.                   stab2arg(A_STAB,
  369.                     $1 == O_FTTTY?stabent("STDIN",TRUE):defstab),
  370.                   Nullarg, Nullarg); }
  371. !     |    LOCAL '(' expr crp
  372.               { $$ = l(localize(make_op(O_ASSIGN, 1,
  373.                   localize(listish(make_list($3))),
  374.                   Nullarg,Nullarg))); }
  375. !     |    '(' expr crp
  376.               { $$ = make_list($2); }
  377.       |    '(' ')'
  378.               { $$ = make_list(Nullarg); }
  379.       |    DO sexpr    %prec FILETEST
  380. ***************
  381. *** 478,484 ****
  382.                   stab2arg(A_STAB,hadd($1)),
  383.                   jmaybe($3),
  384.                   Nullarg); }
  385. !     |    '(' expr ')' '[' expr ']'    %prec '('
  386.               { $$ = make_op(O_LSLICE, 3,
  387.                   Nullarg,
  388.                   listish(make_list($5)),
  389. --- 492,498 ----
  390.                   stab2arg(A_STAB,hadd($1)),
  391.                   jmaybe($3),
  392.                   Nullarg); }
  393. !     |    '(' expr crp '[' expr ']'    %prec '('
  394.               { $$ = make_op(O_LSLICE, 3,
  395.                   Nullarg,
  396.                   listish(make_list($5)),
  397. ***************
  398. *** 513,552 ****
  399.               { $$ = $1; }
  400.       |    TRANS    %prec '('
  401.               { $$ = $1; }
  402. !     |    DO WORD '(' expr ')'
  403.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  404. !                 stab2arg(A_WORD,stabent($2,TRUE)),
  405.                   make_list($4),
  406.                   Nullarg); Safefree($2); $2 = Nullch;
  407.                   $$->arg_flags |= AF_DEPR; }
  408. !     |    AMPER WORD '(' expr ')'
  409.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  410. !                 stab2arg(A_WORD,stabent($2,TRUE)),
  411.                   make_list($4),
  412.                   Nullarg); Safefree($2); $2 = Nullch; }
  413.       |    DO WORD '(' ')'
  414.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  415. !                 stab2arg(A_WORD,stabent($2,TRUE)),
  416.                   make_list(Nullarg),
  417.                   Nullarg);
  418.                   $$->arg_flags |= AF_DEPR; }
  419.       |    AMPER WORD '(' ')'
  420.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  421. !                 stab2arg(A_WORD,stabent($2,TRUE)),
  422.                   make_list(Nullarg),
  423.                   Nullarg); }
  424.       |    AMPER WORD
  425.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  426. !                 stab2arg(A_WORD,stabent($2,TRUE)),
  427.                   Nullarg,
  428.                   Nullarg); }
  429. !     |    DO REG '(' expr ')'
  430.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  431.                   stab2arg(A_STAB,$2),
  432.                   make_list($4),
  433.                   Nullarg);
  434.                   $$->arg_flags |= AF_DEPR; }
  435. !     |    AMPER REG '(' expr ')'
  436.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  437.                   stab2arg(A_STAB,$2),
  438.                   make_list($4),
  439. --- 527,566 ----
  440.               { $$ = $1; }
  441.       |    TRANS    %prec '('
  442.               { $$ = $1; }
  443. !     |    DO WORD '(' expr crp
  444.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  445. !                 stab2arg(A_WORD,stabent($2,MULTI)),
  446.                   make_list($4),
  447.                   Nullarg); Safefree($2); $2 = Nullch;
  448.                   $$->arg_flags |= AF_DEPR; }
  449. !     |    AMPER WORD '(' expr crp
  450.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  451. !                 stab2arg(A_WORD,stabent($2,MULTI)),
  452.                   make_list($4),
  453.                   Nullarg); Safefree($2); $2 = Nullch; }
  454.       |    DO WORD '(' ')'
  455.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  456. !                 stab2arg(A_WORD,stabent($2,MULTI)),
  457.                   make_list(Nullarg),
  458.                   Nullarg);
  459.                   $$->arg_flags |= AF_DEPR; }
  460.       |    AMPER WORD '(' ')'
  461.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  462. !                 stab2arg(A_WORD,stabent($2,MULTI)),
  463.                   make_list(Nullarg),
  464.                   Nullarg); }
  465.       |    AMPER WORD
  466.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  467. !                 stab2arg(A_WORD,stabent($2,MULTI)),
  468.                   Nullarg,
  469.                   Nullarg); }
  470. !     |    DO REG '(' expr crp
  471.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  472.                   stab2arg(A_STAB,$2),
  473.                   make_list($4),
  474.                   Nullarg);
  475.                   $$->arg_flags |= AF_DEPR; }
  476. !     |    AMPER REG '(' expr crp
  477.               { $$ = make_op((perldb ? O_DBSUBR : O_SUBR), 2,
  478.                   stab2arg(A_STAB,$2),
  479.                   make_list($4),
  480. ***************
  481. *** 574,583 ****
  482. --- 588,605 ----
  483.                   Nullarg,Nullarg); }
  484.       |    UNIOP
  485.               { $$ = make_op($1,0,Nullarg,Nullarg,Nullarg); }
  486. +     |    UNIOP block
  487. +             { $$ = make_op($1,1,cmd_to_arg($2),Nullarg,Nullarg); }
  488.       |    UNIOP sexpr
  489.               { $$ = make_op($1,1,$2,Nullarg,Nullarg); }
  490.       |    SSELECT
  491.               { $$ = make_op(O_SELECT, 0, Nullarg, Nullarg, Nullarg);}
  492. +     |    SSELECT  WORD
  493. +             { $$ = make_op(O_SELECT, 1,
  494. +                 stab2arg(A_WORD,stabent($2,TRUE)),
  495. +                 Nullarg,
  496. +                 Nullarg);
  497. +                 Safefree($2); $2 = Nullch; }
  498.       |    SSELECT '(' handle ')'
  499.               { $$ = make_op(O_SELECT, 1, $3, Nullarg, Nullarg); }
  500.       |    SSELECT '(' sexpr csexpr csexpr csexpr ')'
  501. ***************
  502. *** 628,637 ****
  503.       |    FILOP25 '(' handle ',' handle csexpr csexpr cexpr ')'
  504.               { arg4 = $7; arg5 = $8;
  505.                 $$ = make_op($1, 5, $3, $5, $6); }
  506. !     |    PUSH '(' aryword cexpr ')'
  507.               { $$ = make_op($1, 2,
  508.                   $3,
  509. !                 make_list($4),
  510.                   Nullarg); }
  511.       |    POP aryword    %prec '('
  512.               { $$ = make_op(O_POP, 1, $2, Nullarg, Nullarg); }
  513. --- 650,659 ----
  514.       |    FILOP25 '(' handle ',' handle csexpr csexpr cexpr ')'
  515.               { arg4 = $7; arg5 = $8;
  516.                 $$ = make_op($1, 5, $3, $5, $6); }
  517. !     |    PUSH '(' aryword ',' expr crp
  518.               { $$ = make_op($1, 2,
  519.                   $3,
  520. !                 make_list($5),
  521.                   Nullarg); }
  522.       |    POP aryword    %prec '('
  523.               { $$ = make_op(O_POP, 1, $2, Nullarg, Nullarg); }
  524. ***************
  525. *** 671,677 ****
  526.                   $3,
  527.                   listish(make_list($4)),
  528.                   Nullarg); }
  529. !     |    FLIST '(' expr ')'
  530.               { $$ = make_op($1, 1,
  531.                   make_list($3),
  532.                   Nullarg,
  533. --- 693,699 ----
  534.                   $3,
  535.                   listish(make_list($4)),
  536.                   Nullarg); }
  537. !     |    FLIST '(' expr crp
  538.               { $$ = make_op($1, 1,
  539.                   make_list($3),
  540.                   Nullarg,
  541. ***************
  542. *** 752,757 ****
  543. --- 774,784 ----
  544.                   stab2arg(A_STAB,$2),
  545.                   maybelistish($1,make_list($3)),
  546.                   Nullarg); }
  547. +     |    LISTOP block expr
  548. +             { $$ = make_op($1,2,
  549. +                 cmd_to_arg($2),
  550. +                 maybelistish($1,make_list($3)),
  551. +                 Nullarg); }
  552.       ;
  553.   
  554.   handle    :    WORD
  555. ***************
  556. *** 774,779 ****
  557. --- 801,812 ----
  558.               { $$ = stab2arg(A_STAB,$1); }
  559.       ;
  560.   
  561. + crp    :    ',' ')'
  562. +             { $$ = 1; }
  563. +     |    ')'
  564. +             { $$ = 0; }
  565. +     ;
  566.   /*
  567.    * NOTE:  The following entry must stay at the end of the file so that
  568.    * reduce/reduce conflicts resolve to it only if it's the only option.
  569. ***************
  570. *** 785,791 ****
  571.                   $$->arg_type = O_ITEM;
  572.                   $$[1].arg_type = A_SINGLE;
  573.                   $$[1].arg_ptr.arg_str = str_make($1,0);
  574. !                 for (s = $1; *s && islower(*s); s++) ;
  575.                   if (dowarn && !*s)
  576.                   warn(
  577.                     "\"%s\" may clash with future reserved word",
  578. --- 818,824 ----
  579.                   $$->arg_type = O_ITEM;
  580.                   $$[1].arg_type = A_SINGLE;
  581.                   $$[1].arg_ptr.arg_str = str_make($1,0);
  582. !                 for (s = $1; *s && isLOWER(*s); s++) ;
  583.                   if (dowarn && !*s)
  584.                   warn(
  585.                     "\"%s\" may clash with future reserved word",
  586.  
  587. Index: regcomp.c
  588. *** regcomp.c.old    Tue Nov  5 19:27:40 1991
  589. --- regcomp.c    Tue Nov  5 19:27:41 1991
  590. ***************
  591. *** 7,15 ****
  592.    * blame Henry for some of the lack of readability.
  593.    */
  594.   
  595. ! /* $RCSfile: regcomp.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:48:24 $
  596.    *
  597.    * $Log:    regcomp.c,v $
  598.    * Revision 4.0.1.2  91/06/07  11:48:24  lwall
  599.    * patch4: new copyright notice
  600.    * patch4: /(x+) \1/ incorrectly optimized to not match "xxx xx"
  601. --- 7,21 ----
  602.    * blame Henry for some of the lack of readability.
  603.    */
  604.   
  605. ! /* $RCSfile: regcomp.c,v $$Revision: 4.0.1.3 $$Date: 91/11/05 18:22:28 $
  606.    *
  607.    * $Log:    regcomp.c,v $
  608. +  * Revision 4.0.1.3  91/11/05  18:22:28  lwall
  609. +  * patch11: minimum match length calculation in regexp is now cumulative
  610. +  * patch11: initial .* in pattern had dependency on value of $*
  611. +  * patch11: certain patterns made use of garbage pointers from uncleared memory
  612. +  * patch11: prepared for ctype implementations that don't define isascii()
  613. +  * 
  614.    * Revision 4.0.1.2  91/06/07  11:48:24  lwall
  615.    * patch4: new copyright notice
  616.    * patch4: /(x+) \1/ incorrectly optimized to not match "xxx xx"
  617. ***************
  618. *** 22,28 ****
  619.    * 4.0 baseline.
  620.    * 
  621.    */
  622.   /*
  623.    * regcomp and regexec -- regsub and regerror are not used in perl
  624.    *
  625. --- 28,34 ----
  626.    * 4.0 baseline.
  627.    * 
  628.    */
  629. ! /*SUPPRESS 112*/
  630.   /*
  631.    * regcomp and regexec -- regsub and regerror are not used in perl
  632.    *
  633. ***************
  634. *** 150,155 ****
  635. --- 156,162 ----
  636.       int backish;
  637.       int backest;
  638.       int curback;
  639. +     int minlen;
  640.       extern char *safemalloc();
  641.       extern char *savestr();
  642.       int sawplus = 0;
  643. ***************
  644. *** 168,174 ****
  645.       regnpar = 1;
  646.       regsize = 0L;
  647.       regcode = ®dummy;
  648. !     regc(MAGIC);
  649.       if (reg(0, &flags) == NULL) {
  650.           Safefree(regprecomp);
  651.           regprecomp = Nullch;
  652. --- 175,181 ----
  653.       regnpar = 1;
  654.       regsize = 0L;
  655.       regcode = ®dummy;
  656. !     regc((char)MAGIC);
  657.       if (reg(0, &flags) == NULL) {
  658.           Safefree(regprecomp);
  659.           regprecomp = Nullch;
  660. ***************
  661. *** 193,199 ****
  662.       regparse = exp;
  663.       regnpar = 1;
  664.       regcode = r->program;
  665. !     regc(MAGIC);
  666.       if (reg(0, &flags) == NULL)
  667.           return(NULL);
  668.   
  669. --- 200,206 ----
  670.       regparse = exp;
  671.       regnpar = 1;
  672.       regcode = r->program;
  673. !     regc((char)MAGIC);
  674.       if (reg(0, &flags) == NULL)
  675.           return(NULL);
  676.   
  677. ***************
  678. *** 233,239 ****
  679.               r->regstclass = first;
  680.           else if (OP(first) == BOL ||
  681.               (OP(first) == STAR && OP(NEXTOPER(first)) == ANY) ) {
  682. !             r->reganch = ROPT_ANCH;    /* kinda turn .* into ^.* */
  683.               first = NEXTOPER(first);
  684.                   goto again;
  685.           }
  686. --- 240,247 ----
  687.               r->regstclass = first;
  688.           else if (OP(first) == BOL ||
  689.               (OP(first) == STAR && OP(NEXTOPER(first)) == ANY) ) {
  690. !             /* kinda turn .* into ^.* */
  691. !             r->reganch = ROPT_ANCH | ROPT_IMPLICIT;
  692.               first = NEXTOPER(first);
  693.                   goto again;
  694.           }
  695. ***************
  696. *** 259,264 ****
  697. --- 267,273 ----
  698.           longish = str_make("",0);
  699.           longest = str_make("",0);
  700.           len = 0;
  701. +         minlen = 0;
  702.           curback = 0;
  703.           backish = 0;
  704.           backest = 0;
  705. ***************
  706. *** 278,283 ****
  707. --- 287,293 ----
  708.                   first = scan;
  709.                   while (OP(t = regnext(scan)) == CLOSE)
  710.                   scan = t;
  711. +                 minlen += *OPERAND(first);
  712.                   if (curback - backish == len) {
  713.                   str_ncat(longish, OPERAND(first)+1,
  714.                       *OPERAND(first));
  715. ***************
  716. *** 303,311 ****
  717. --- 313,328 ----
  718.                   backest = backish;
  719.                   }
  720.                   str_nset(longish,"",0);
  721. +                 if (OP(scan) == PLUS &&
  722. +                   index(simple,OP(NEXTOPER(scan))))
  723. +                 minlen++;
  724. +                 else if (OP(scan) == CURLY &&
  725. +                   index(simple,OP(NEXTOPER(scan)+4)))
  726. +                 minlen += ARG1(scan);
  727.               }
  728.               else if (index(simple,OP(scan))) {
  729.                   curback++;
  730. +                 minlen++;
  731.                   len = 0;
  732.                   if (longish->str_cur > longest->str_cur) {
  733.                   str_sset(longest,longish);
  734. ***************
  735. *** 328,335 ****
  736.               &&
  737.               (!r->regstart
  738.                ||
  739. !              !fbminstr(r->regstart->str_ptr,
  740. !               r->regstart->str_ptr + r->regstart->str_cur,
  741.                 longest)
  742.               )
  743.              )
  744. --- 345,353 ----
  745.               &&
  746.               (!r->regstart
  747.                ||
  748. !              !fbminstr((unsigned char*) r->regstart->str_ptr,
  749. !               (unsigned char *) r->regstart->str_ptr
  750. !                 + r->regstart->str_cur,
  751.                 longest)
  752.               )
  753.              )
  754. ***************
  755. *** 354,361 ****
  756.   
  757.       r->do_folding = fold;
  758.       r->nparens = regnpar - 1;
  759. !     New(1002, r->startp, regnpar, char*);
  760. !     New(1002, r->endp, regnpar, char*);
  761.   #ifdef DEBUGGING
  762.       if (debug & 512)
  763.           regdump(r);
  764. --- 372,380 ----
  765.   
  766.       r->do_folding = fold;
  767.       r->nparens = regnpar - 1;
  768. !     r->minlen = minlen;
  769. !     Newz(1002, r->startp, regnpar, char*);
  770. !     Newz(1002, r->endp, regnpar, char*);
  771.   #ifdef DEBUGGING
  772.       if (debug & 512)
  773.           regdump(r);
  774. ***************
  775. *** 515,521 ****
  776.       if (op == '{' && regcurly(regparse)) {
  777.           next = regparse + 1;
  778.           max = Nullch;
  779. !         while (isdigit(*next) || *next == ',') {
  780.           if (*next == ',') {
  781.               if (max)
  782.               break;
  783. --- 534,540 ----
  784.       if (op == '{' && regcurly(regparse)) {
  785.           next = regparse + 1;
  786.           max = Nullch;
  787. !         while (isDIGIT(*next) || *next == ',') {
  788.           if (*next == ',') {
  789.               if (max)
  790.               break;
  791. ***************
  792. *** 758,764 ****
  793.                   else {
  794.                   regsawback = 1;
  795.                   ret = reganode(REF, num);
  796. !                 while (isascii(*regparse) && isdigit(*regparse))
  797.                       regparse++;
  798.                   *flagp |= SIMPLE;
  799.                   }
  800. --- 777,783 ----
  801.                   else {
  802.                   regsawback = 1;
  803.                   ret = reganode(REF, num);
  804. !                 while (isDIGIT(*regparse))
  805.                       regparse++;
  806.                   *flagp |= SIMPLE;
  807.                   }
  808. ***************
  809. *** 839,845 ****
  810.                   case 'c':
  811.                       p++;
  812.                       ender = *p++;
  813. !                     if (islower(ender))
  814.                       ender = toupper(ender);
  815.                       ender ^= 64;
  816.                       break;
  817. --- 858,864 ----
  818.                   case 'c':
  819.                       p++;
  820.                       ender = *p++;
  821. !                     if (isLOWER(ender))
  822.                       ender = toupper(ender);
  823.                       ender ^= 64;
  824.                       break;
  825. ***************
  826. *** 846,852 ****
  827.                   case '0': case '1': case '2': case '3':case '4':
  828.                   case '5': case '6': case '7': case '8':case '9':
  829.                       if (*p == '0' ||
  830. !                       (isdigit(p[1]) && atoi(p) >= regnpar) ) {
  831.                       ender = scanoct(p, 3, &numlen);
  832.                       p += numlen;
  833.                       }
  834. --- 865,871 ----
  835.                   case '0': case '1': case '2': case '3':case '4':
  836.                   case '5': case '6': case '7': case '8':case '9':
  837.                       if (*p == '0' ||
  838. !                       (isDIGIT(p[1]) && atoi(p) >= regnpar) ) {
  839.                       ender = scanoct(p, 3, &numlen);
  840.                       p += numlen;
  841.                       }
  842. ***************
  843. *** 868,874 ****
  844.                   ender = *p++;
  845.                   break;
  846.                   }
  847. !                 if (regfold && isupper(ender))
  848.                       ender = tolower(ender);
  849.                   if (ISMULT2(p)) { /* Back off on ?+*. */
  850.                   if (len)
  851. --- 887,893 ----
  852.                   ender = *p++;
  853.                   break;
  854.                   }
  855. !                 if (regfold && isUPPER(ender))
  856.                       ender = tolower(ender);
  857.                   if (ISMULT2(p)) { /* Back off on ?+*. */
  858.                   if (len)
  859. ***************
  860. *** 992,998 ****
  861.                   break;
  862.               case 'c':
  863.                   class = *regparse++;
  864. !                 if (islower(class))
  865.                       class = toupper(class);
  866.                   class ^= 64;
  867.                   break;
  868. --- 1011,1017 ----
  869.                   break;
  870.               case 'c':
  871.                   class = *regparse++;
  872. !                 if (isLOWER(class))
  873.                       class = toupper(class);
  874.                   class ^= 64;
  875.                   break;
  876. ***************
  877. *** 1019,1025 ****
  878.           }
  879.           for ( ; lastclass <= class; lastclass++) {
  880.               regset(bits,def,lastclass);
  881. !             if (regfold && isupper(lastclass))
  882.                   regset(bits,def,tolower(lastclass));
  883.           }
  884.           lastclass = class;
  885. --- 1038,1044 ----
  886.           }
  887.           for ( ; lastclass <= class; lastclass++) {
  888.               regset(bits,def,lastclass);
  889. !             if (regfold && isUPPER(lastclass))
  890.                   regset(bits,def,tolower(lastclass));
  891.           }
  892.           lastclass = class;
  893. ***************
  894. *** 1226,1238 ****
  895.   {
  896.       if (*s++ != '{')
  897.       return FALSE;
  898. !     if (!isdigit(*s))
  899.       return FALSE;
  900. !     while (isdigit(*s))
  901.       s++;
  902.       if (*s == ',')
  903.       s++;
  904. !     while (isdigit(*s))
  905.       s++;
  906.       if (*s != '}')
  907.       return FALSE;
  908. --- 1245,1257 ----
  909.   {
  910.       if (*s++ != '{')
  911.       return FALSE;
  912. !     if (!isDIGIT(*s))
  913.       return FALSE;
  914. !     while (isDIGIT(*s))
  915.       s++;
  916.       if (*s == ',')
  917.       s++;
  918. !     while (isDIGIT(*s))
  919.       s++;
  920.       if (*s != '}')
  921.       return FALSE;
  922. ***************
  923. *** 1292,1300 ****
  924. --- 1311,1322 ----
  925.           fprintf(stderr,"anchored ");
  926.       if (r->reganch & ROPT_SKIP)
  927.           fprintf(stderr,"plus ");
  928. +     if (r->reganch & ROPT_IMPLICIT)
  929. +         fprintf(stderr,"implicit ");
  930.       if (r->regmust != NULL)
  931.           fprintf(stderr,"must have \"%s\" back %d ", r->regmust->str_ptr,
  932.             r->regback);
  933. +     fprintf(stderr, "minlen %d ", r->minlen);
  934.       fprintf(stderr,"\n");
  935.   }
  936.   
  937.  
  938. Index: regexec.c
  939. *** regexec.c.old    Tue Nov  5 19:27:44 1991
  940. --- regexec.c    Tue Nov  5 19:27:44 1991
  941. ***************
  942. *** 7,15 ****
  943.    * blame Henry for some of the lack of readability.
  944.    */
  945.   
  946. ! /* $RCSfile: regexec.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:50:33 $
  947.    *
  948.    * $Log:    regexec.c,v $
  949.    * Revision 4.0.1.2  91/06/07  11:50:33  lwall
  950.    * patch4: new copyright notice
  951.    * patch4: // wouldn't use previous pattern if it started with a null character
  952. --- 7,19 ----
  953.    * blame Henry for some of the lack of readability.
  954.    */
  955.   
  956. ! /* $RCSfile: regexec.c,v $$Revision: 4.0.1.3 $$Date: 91/11/05 18:23:55 $
  957.    *
  958.    * $Log:    regexec.c,v $
  959. +  * Revision 4.0.1.3  91/11/05  18:23:55  lwall
  960. +  * patch11: prepared for ctype implementations that don't define isascii()
  961. +  * patch11: initial .* in pattern had dependency on value of $*
  962. +  * 
  963.    * Revision 4.0.1.2  91/06/07  11:50:33  lwall
  964.    * patch4: new copyright notice
  965.    * patch4: // wouldn't use previous pattern if it started with a null character
  966. ***************
  967. *** 21,27 ****
  968.    * 4.0 baseline.
  969.    * 
  970.    */
  971.   /*
  972.    * regcomp and regexec -- regsub and regerror are not used in perl
  973.    *
  974. --- 25,31 ----
  975.    * 4.0 baseline.
  976.    * 
  977.    */
  978. ! /*SUPPRESS 112*/
  979.   /*
  980.    * regcomp and regexec -- regsub and regerror are not used in perl
  981.    *
  982. ***************
  983. *** 65,75 ****
  984.   int regnarrate = 0;
  985.   #endif
  986.   
  987. - #define isALNUM(c) (isascii(c) && (isalpha(c) || isdigit(c) || c == '_'))
  988. - #define isSPACE(c) (isascii(c) && isspace(c))
  989. - #define isDIGIT(c) (isascii(c) && isdigit(c))
  990. - #define isUPPER(c) (isascii(c) && isupper(c))
  991.   /*
  992.    * regexec and friends
  993.    */
  994. --- 69,74 ----
  995. ***************
  996. *** 221,227 ****
  997.       if (prog->reganch & ROPT_ANCH) {
  998.           if (regtry(prog, string))
  999.               goto got_it;
  1000. !         else if (multiline) {
  1001.               if (minlen)
  1002.                   dontbother = minlen - 1;
  1003.               strend -= dontbother;
  1004. --- 220,226 ----
  1005.       if (prog->reganch & ROPT_ANCH) {
  1006.           if (regtry(prog, string))
  1007.               goto got_it;
  1008. !         else if (multiline || (prog->reganch & ROPT_IMPLICIT)) {
  1009.               if (minlen)
  1010.                   dontbother = minlen - 1;
  1011.               strend -= dontbother;
  1012. ***************
  1013. *** 279,284 ****
  1014. --- 278,284 ----
  1015.           }
  1016.           goto phooey;
  1017.       }
  1018. +     /*SUPPRESS 560*/
  1019.       if (c = prog->regstclass) {
  1020.           int doevery = (prog->reganch & ROPT_SKIP) == 0;
  1021.   
  1022. ***************
  1023. *** 721,726 ****
  1024. --- 721,727 ----
  1025.                           if (regmatch(NEXTOPER(scan)))
  1026.                               return(1);
  1027.   #ifdef REGALIGN
  1028. +                         /*SUPPRESS 560*/
  1029.                           if (n = NEXT(scan))
  1030.                               scan += n;
  1031.                           else
  1032.  
  1033. Index: stab.c
  1034. *** stab.c.old    Tue Nov  5 19:27:48 1991
  1035. --- stab.c    Tue Nov  5 19:27:49 1991
  1036. ***************
  1037. *** 1,4 ****
  1038. ! /* $RCSfile: stab.c,v $$Revision: 4.0.1.2 $$Date: 91/06/07 11:55:53 $
  1039.    *
  1040.    *    Copyright (c) 1991, Larry Wall
  1041.    *
  1042. --- 1,4 ----
  1043. ! /* $RCSfile: stab.c,v $$Revision: 4.0.1.3 $$Date: 91/11/05 18:35:33 $
  1044.    *
  1045.    *    Copyright (c) 1991, Larry Wall
  1046.    *
  1047. ***************
  1048. *** 6,11 ****
  1049. --- 6,18 ----
  1050.    *    License or the Artistic License, as specified in the README file.
  1051.    *
  1052.    * $Log:    stab.c,v $
  1053. +  * Revision 4.0.1.3  91/11/05  18:35:33  lwall
  1054. +  * patch11: length($x) was sometimes wrong for numeric $x
  1055. +  * patch11: perl now issues warning if $SIG{'ALARM'} is referenced
  1056. +  * patch11: *foo = undef coredumped
  1057. +  * patch11: solitary subroutine references no longer trigger typo warnings
  1058. +  * patch11: local(*FILEHANDLE) had a memory leak
  1059. +  * 
  1060.    * Revision 4.0.1.2  91/06/07  11:55:53  lwall
  1061.    * patch4: new copyright notice
  1062.    * patch4: added $^P variable to control calling of perldb routines
  1063. ***************
  1064. *** 247,253 ****
  1065.       char *s;
  1066.   
  1067.       if (str->str_rare)
  1068. !     return stab_val(stab)->str_cur;
  1069.   
  1070.       switch (*stab->str_magic->str_ptr) {
  1071.       case '1': case '2': case '3': case '4':
  1072. --- 254,260 ----
  1073.       char *s;
  1074.   
  1075.       if (str->str_rare)
  1076. !     return str_len(stab_val(stab));
  1077.   
  1078.       switch (*stab->str_magic->str_ptr) {
  1079.       case '1': case '2': case '3': case '4':
  1080. ***************
  1081. *** 303,309 ****
  1082.       case '\\':
  1083.       return (STRLEN)orslen;
  1084.       default:
  1085. !     return stab_str(str)->str_cur;
  1086.       }
  1087.   }
  1088.   
  1089. --- 310,316 ----
  1090.       case '\\':
  1091.       return (STRLEN)orslen;
  1092.       default:
  1093. !     return str_len(stab_str(str));
  1094.       }
  1095.   }
  1096.   
  1097. ***************
  1098. *** 311,317 ****
  1099.   register STR *mstr;
  1100.   STR *str;
  1101.   {
  1102. !     STAB *stab = mstr->str_u.str_stab;
  1103.       register char *s;
  1104.       int i;
  1105.   
  1106. --- 318,324 ----
  1107.   register STR *mstr;
  1108.   STR *str;
  1109.   {
  1110. !     STAB *stab;
  1111.       register char *s;
  1112.       int i;
  1113.   
  1114. ***************
  1115. *** 338,343 ****
  1116. --- 345,352 ----
  1117.       case 'S':
  1118.       s = str_get(str);
  1119.       i = whichsig(mstr->str_ptr);    /* ...no, a brick */
  1120. +     if (!i && (dowarn || strEQ(mstr->str_ptr,"ALARM")))
  1121. +         warn("No such signal: SIG%s", mstr->str_ptr);
  1122.       if (strEQ(s,"IGNORE"))
  1123.   #ifndef lint
  1124.           (void)signal(i,SIG_IGN);
  1125. ***************
  1126. *** 356,361 ****
  1127. --- 365,371 ----
  1128.       break;
  1129.   #ifdef SOME_DBM
  1130.       case 'D':
  1131. +     stab = mstr->str_u.str_stab;
  1132.       hdbmstore(stab_hash(stab),mstr->str_ptr,mstr->str_cur,str);
  1133.       break;
  1134.   #endif
  1135. ***************
  1136. *** 363,368 ****
  1137. --- 373,379 ----
  1138.       {
  1139.           CMD *cmd;
  1140.   
  1141. +         stab = mstr->str_u.str_stab;
  1142.           i = str_true(str);
  1143.           str = afetch(stab_xarray(stab),atoi(mstr->str_ptr), FALSE);
  1144.           cmd = str->str_magic->str_u.str_cmd;
  1145. ***************
  1146. *** 371,386 ****
  1147.       }
  1148.       break;
  1149.       case '#':
  1150.       afill(stab_array(stab), (int)str_gnum(str) - arybase);
  1151.       break;
  1152.       case 'X':    /* merely a copy of a * string */
  1153.       break;
  1154.       case '*':
  1155. !     s = str_get(str);
  1156.       if (strNE(s,"StB") || str->str_cur != sizeof(STBP)) {
  1157.           if (!*s) {
  1158.           STBP *stbp;
  1159.   
  1160.           (void)savenostab(stab);    /* schedule a free of this stab */
  1161.           if (stab->str_len)
  1162.               Safefree(stab->str_ptr);
  1163. --- 382,400 ----
  1164.       }
  1165.       break;
  1166.       case '#':
  1167. +     stab = mstr->str_u.str_stab;
  1168.       afill(stab_array(stab), (int)str_gnum(str) - arybase);
  1169.       break;
  1170.       case 'X':    /* merely a copy of a * string */
  1171.       break;
  1172.       case '*':
  1173. !     s = str->str_pok ? str_get(str) : "";
  1174.       if (strNE(s,"StB") || str->str_cur != sizeof(STBP)) {
  1175. +         stab = mstr->str_u.str_stab;
  1176.           if (!*s) {
  1177.           STBP *stbp;
  1178.   
  1179. +         /*SUPPRESS 701*/
  1180.           (void)savenostab(stab);    /* schedule a free of this stab */
  1181.           if (stab->str_len)
  1182.               Safefree(stab->str_ptr);
  1183. ***************
  1184. *** 402,408 ****
  1185.           if (!stab_io(stab))
  1186.               stab_io(stab) = stio_new();
  1187.           }
  1188. !         str_sset(str,stab);
  1189.       }
  1190.       break;
  1191.       case 's': {
  1192. --- 416,422 ----
  1193.           if (!stab_io(stab))
  1194.               stab_io(stab) = stio_new();
  1195.           }
  1196. !         str_sset(str, (STR*) stab);
  1197.       }
  1198.       break;
  1199.       case 's': {
  1200. ***************
  1201. *** 422,427 ****
  1202. --- 436,444 ----
  1203.       break;
  1204.   
  1205.       case 0:
  1206. +     /*SUPPRESS 560*/
  1207. +     if (!(stab = mstr->str_u.str_stab))
  1208. +         break;
  1209.       switch (*stab->str_magic->str_ptr) {
  1210.       case '\004':    /* ^D */
  1211.   #ifdef DEBUGGING
  1212. ***************
  1213. *** 711,716 ****
  1214. --- 728,734 ----
  1215.           sig_name[sig], stab_name(stab) );
  1216.       return;
  1217.       }
  1218. +     /*SUPPRESS 701*/
  1219.       saveaptr(&stack);
  1220.       str = Str_new(15, sizeof(CSV));
  1221.       str->str_state = SS_SCSV;
  1222. ***************
  1223. *** 791,797 ****
  1224.       char *prevquote = Nullch;
  1225.       bool global = FALSE;
  1226.   
  1227. !     if (isascii(*name) && isupper(*name)) {
  1228.       if (*name > 'I') {
  1229.           if (*name == 'S' && (
  1230.             strEQ(name, "SIG") ||
  1231. --- 809,815 ----
  1232.       char *prevquote = Nullch;
  1233.       bool global = FALSE;
  1234.   
  1235. !     if (isUPPER(*name)) {
  1236.       if (*name > 'I') {
  1237.           if (*name == 'S' && (
  1238.             strEQ(name, "SIG") ||
  1239. ***************
  1240. *** 822,830 ****
  1241.       sawquote = Nullch;
  1242.       name++;
  1243.       }
  1244. !     else if (!isalpha(*name) || global)
  1245.       stash = defstash;
  1246. !     else if (curcmd == &compiling)
  1247.       stash = curstash;
  1248.       else
  1249.       stash = curcmd->c_stash;
  1250. --- 840,848 ----
  1251.       sawquote = Nullch;
  1252.       name++;
  1253.       }
  1254. !     else if (!isALPHA(*name) || global)
  1255.       stash = defstash;
  1256. !     else if ((CMD*)curcmd == &compiling)
  1257.       stash = curstash;
  1258.       else
  1259.       stash = curcmd->c_stash;
  1260. ***************
  1261. *** 833,838 ****
  1262. --- 851,857 ----
  1263.       char *s, *d;
  1264.   
  1265.       *sawquote = '\0';
  1266. +     /*SUPPRESS 560*/
  1267.       if (s = prevquote) {
  1268.           strncpy(tmpbuf,name,s-name+1);
  1269.           d = tmpbuf+(s-name+1);
  1270. ***************
  1271. *** 869,880 ****
  1272.       strcpy(stab_magic(stab),"StB");
  1273.       stab_val(stab) = Str_new(72,0);
  1274.       stab_line(stab) = curcmd->c_line;
  1275. !     str_magic(stab,stab,'*',name,len);
  1276.       stab_stash(stab) = stash;
  1277. !     if (isdigit(*name) && *name != '0') {
  1278.           stab_flags(stab) = SF_VMAGIC;
  1279.           str_magic(stab_val(stab), stab, 0, Nullch, 0);
  1280.       }
  1281.       return stab;
  1282.       }
  1283.   }
  1284. --- 888,901 ----
  1285.       strcpy(stab_magic(stab),"StB");
  1286.       stab_val(stab) = Str_new(72,0);
  1287.       stab_line(stab) = curcmd->c_line;
  1288. !     str_magic((STR*)stab, stab, '*', name, len);
  1289.       stab_stash(stab) = stash;
  1290. !     if (isDIGIT(*name) && *name != '0') {
  1291.           stab_flags(stab) = SF_VMAGIC;
  1292.           str_magic(stab_val(stab), stab, 0, Nullch, 0);
  1293.       }
  1294. +     if (add & 2)
  1295. +         stab->str_pok |= SP_MULTI;
  1296.       return stab;
  1297.       }
  1298.   }
  1299. ***************
  1300. *** 945,955 ****
  1301. --- 966,979 ----
  1302.       stab_xhash(stab) = Null(HASH*);
  1303.       str_free(stab_val(stab));
  1304.       stab_val(stab) = Nullstr;
  1305. +     /*SUPPRESS 560*/
  1306.       if (stio = stab_io(stab)) {
  1307.       do_close(stab,FALSE);
  1308.       Safefree(stio->top_name);
  1309.       Safefree(stio->fmt_name);
  1310. +     Safefree(stio);
  1311.       }
  1312. +     /*SUPPRESS 560*/
  1313.       if (sub = stab_sub(stab)) {
  1314.       afree(sub->tosave);
  1315.       cmd_free(sub->cmd);
  1316.  
  1317. Index: stab.h
  1318. *** stab.h.old    Tue Nov  5 19:27:51 1991
  1319. --- stab.h    Tue Nov  5 19:27:52 1991
  1320. ***************
  1321. *** 1,4 ****
  1322. ! /* $RCSfile: stab.h,v $$Revision: 4.0.1.1 $$Date: 91/06/07 11:56:35 $
  1323.    *
  1324.    *    Copyright (c) 1991, Larry Wall
  1325.    *
  1326. --- 1,4 ----
  1327. ! /* $RCSfile: stab.h,v $$Revision: 4.0.1.2 $$Date: 91/11/05 18:36:15 $
  1328.    *
  1329.    *    Copyright (c) 1991, Larry Wall
  1330.    *
  1331. ***************
  1332. *** 6,11 ****
  1333. --- 6,14 ----
  1334.    *    License or the Artistic License, as specified in the README file.
  1335.    *
  1336.    * $Log:    stab.h,v $
  1337. +  * Revision 4.0.1.2  91/11/05  18:36:15  lwall
  1338. +  * patch11: length($x) was sometimes wrong for numeric $x
  1339. +  * 
  1340.    * Revision 4.0.1.1  91/06/07  11:56:35  lwall
  1341.    * patch4: new copyright notice
  1342.    * patch4: length($`), length($&), length($') now optimized to avoid string copy
  1343. ***************
  1344. *** 100,106 ****
  1345.   STRLEN stab_len();
  1346.   
  1347.   #define STAB_STR(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_str(stab_val(tmpstab)->str_magic) : stab_val(tmpstab))
  1348. ! #define STAB_LEN(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_len(stab_val(tmpstab)->str_magic) : stab_val(tmpstab)->str_cur)
  1349.   #define STAB_GET(s) (tmpstab = (s), str_get(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
  1350.   #define STAB_GNUM(s) (tmpstab = (s), str_gnum(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
  1351.   
  1352. --- 103,109 ----
  1353.   STRLEN stab_len();
  1354.   
  1355.   #define STAB_STR(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_str(stab_val(tmpstab)->str_magic) : stab_val(tmpstab))
  1356. ! #define STAB_LEN(s) (tmpstab = (s), stab_flags(tmpstab) & SF_VMAGIC ? stab_len(stab_val(tmpstab)->str_magic) : str_len(stab_val(tmpstab)))
  1357.   #define STAB_GET(s) (tmpstab = (s), str_get(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
  1358.   #define STAB_GNUM(s) (tmpstab = (s), str_gnum(stab_flags(tmpstab) & SF_VMAGIC ? stab_str(tmpstab->str_magic) : stab_val(tmpstab)))
  1359.   
  1360.  
  1361. Index: t/op/stat.t
  1362. *** t/op/stat.t.old    Tue Nov  5 19:28:06 1991
  1363. --- t/op/stat.t    Tue Nov  5 19:28:06 1991
  1364. ***************
  1365. *** 1,6 ****
  1366.   #!./perl
  1367.   
  1368. ! # $RCSfile: stat.t,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:02:42 $
  1369.   
  1370.   print "1..56\n";
  1371.   
  1372. --- 1,6 ----
  1373.   #!./perl
  1374.   
  1375. ! # $RCSfile: stat.t,v $$Revision: 4.0.1.2 $$Date: 91/11/05 18:44:44 $
  1376.   
  1377.   print "1..56\n";
  1378.   
  1379. ***************
  1380. *** 9,23 ****
  1381.   $DEV = `ls -l /dev`;
  1382.   
  1383.   unlink "Op.stat.tmp";
  1384. ! open(foo, ">Op.stat.tmp");
  1385.   
  1386.   ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1387. !     $blksize,$blocks) = stat(foo);
  1388.   if ($nlink == 1) {print "ok 1\n";} else {print "not ok 1\n";}
  1389.   if ($mtime && $mtime == $ctime) {print "ok 2\n";} else {print "not ok 2\n";}
  1390.   
  1391. ! print foo "Now is the time for all good men to come to.\n";
  1392. ! close(foo);
  1393.   
  1394.   sleep 2;
  1395.   
  1396. --- 9,23 ----
  1397.   $DEV = `ls -l /dev`;
  1398.   
  1399.   unlink "Op.stat.tmp";
  1400. ! open(FOO, ">Op.stat.tmp");
  1401.   
  1402.   ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,
  1403. !     $blksize,$blocks) = stat(FOO);
  1404.   if ($nlink == 1) {print "ok 1\n";} else {print "not ok 1\n";}
  1405.   if ($mtime && $mtime == $ctime) {print "ok 2\n";} else {print "not ok 2\n";}
  1406.   
  1407. ! print FOO "Now is the time for all good men to come to.\n";
  1408. ! close(FOO);
  1409.   
  1410.   sleep 2;
  1411.   
  1412. ***************
  1413. *** 141,164 ****
  1414.   if (-B './perl') {print "ok 43\n";} else {print "not ok 43\n";}
  1415.   if (! -T './perl') {print "ok 44\n";} else {print "not ok 44\n";}
  1416.   
  1417. ! open(foo,'op/stat.t');
  1418. ! if (-T foo) {print "ok 45\n";} else {print "not ok 45\n";}
  1419. ! if (! -B foo) {print "ok 46\n";} else {print "not ok 46\n";}
  1420. ! $_ = <foo>;
  1421. ! if (/perl/) {print "ok 47\n";} else {print "not ok 47\n";}
  1422. ! if (-T foo) {print "ok 48\n";} else {print "not ok 48\n";}
  1423. ! if (! -B foo) {print "ok 49\n";} else {print "not ok 49\n";}
  1424. ! close(foo);
  1425.   
  1426. ! open(foo,'op/stat.t');
  1427. ! $_ = <foo>;
  1428. ! if (/perl/) {print "ok 50\n";} else {print "not ok 50\n";}
  1429. ! if (-T foo) {print "ok 51\n";} else {print "not ok 51\n";}
  1430. ! if (! -B foo) {print "ok 52\n";} else {print "not ok 52\n";}
  1431. ! seek(foo,0,0);
  1432. ! if (-T foo) {print "ok 53\n";} else {print "not ok 53\n";}
  1433. ! if (! -B foo) {print "ok 54\n";} else {print "not ok 54\n";}
  1434. ! close(foo);
  1435.   
  1436.   if (-T '/dev/null') {print "ok 55\n";} else {print "not ok 55\n";}
  1437.   if (-B '/dev/null') {print "ok 56\n";} else {print "not ok 56\n";}
  1438. --- 141,173 ----
  1439.   if (-B './perl') {print "ok 43\n";} else {print "not ok 43\n";}
  1440.   if (! -T './perl') {print "ok 44\n";} else {print "not ok 44\n";}
  1441.   
  1442. ! open(FOO,'op/stat.t');
  1443. ! eval { -T FOO; };
  1444. ! if ($@ =~ /not implemented/) {
  1445. !     print "# $@";
  1446. !     for (45 .. 54) {
  1447. !     print "ok $_\n";
  1448. !     }
  1449. ! }
  1450. ! else {
  1451. !     if (-T FOO) {print "ok 45\n";} else {print "not ok 45\n";}
  1452. !     if (! -B FOO) {print "ok 46\n";} else {print "not ok 46\n";}
  1453. !     $_ = <FOO>;
  1454. !     if (/perl/) {print "ok 47\n";} else {print "not ok 47\n";}
  1455. !     if (-T FOO) {print "ok 48\n";} else {print "not ok 48\n";}
  1456. !     if (! -B FOO) {print "ok 49\n";} else {print "not ok 49\n";}
  1457. !     close(FOO);
  1458.   
  1459. !     open(FOO,'op/stat.t');
  1460. !     $_ = <FOO>;
  1461. !     if (/perl/) {print "ok 50\n";} else {print "not ok 50\n";}
  1462. !     if (-T FOO) {print "ok 51\n";} else {print "not ok 51\n";}
  1463. !     if (! -B FOO) {print "ok 52\n";} else {print "not ok 52\n";}
  1464. !     seek(FOO,0,0);
  1465. !     if (-T FOO) {print "ok 53\n";} else {print "not ok 53\n";}
  1466. !     if (! -B FOO) {print "ok 54\n";} else {print "not ok 54\n";}
  1467. ! }
  1468. ! close(FOO);
  1469.   
  1470.   if (-T '/dev/null') {print "ok 55\n";} else {print "not ok 55\n";}
  1471.   if (-B '/dev/null') {print "ok 56\n";} else {print "not ok 56\n";}
  1472.  
  1473. Index: hints/stellar.sh
  1474. *** hints/stellar.sh.old    Tue Nov  5 19:26:37 1991
  1475. --- hints/stellar.sh    Tue Nov  5 19:26:38 1991
  1476. ***************
  1477. *** 0 ****
  1478. --- 1,2 ----
  1479. + optimize="-O0"
  1480. + ccflags="$ccflags -nw"
  1481.  
  1482. Index: str.c
  1483. *** str.c.old    Tue Nov  5 19:27:54 1991
  1484. --- str.c    Tue Nov  5 19:27:55 1991
  1485. ***************
  1486. *** 1,4 ****
  1487. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.3 $$Date: 91/06/10 01:27:54 $
  1488.    *
  1489.    *    Copyright (c) 1991, Larry Wall
  1490.    *
  1491. --- 1,4 ----
  1492. ! /* $RCSfile: str.c,v $$Revision: 4.0.1.4 $$Date: 91/11/05 18:40:51 $
  1493.    *
  1494.    *    Copyright (c) 1991, Larry Wall
  1495.    *
  1496. ***************
  1497. *** 6,11 ****
  1498. --- 6,16 ----
  1499.    *    License or the Artistic License, as specified in the README file.
  1500.    *
  1501.    * $Log:    str.c,v $
  1502. +  * Revision 4.0.1.4  91/11/05  18:40:51  lwall
  1503. +  * patch11: $foo .= <BAR> could overrun malloced memory
  1504. +  * patch11: \$ didn't always make it through double-quoter to regexp routines
  1505. +  * patch11: prepared for ctype implementations that don't define isascii()
  1506. +  * 
  1507.    * Revision 4.0.1.3  91/06/10  01:27:54  lwall
  1508.    * patch10: $) and $| incorrectly handled in run-time patterns
  1509.    * 
  1510. ***************
  1511. *** 255,260 ****
  1512. --- 260,266 ----
  1513.           }
  1514.           str_nset(dstr,sstr->str_ptr,sstr->str_cur);
  1515.       }
  1516. +     /*SUPPRESS 560*/
  1517.       if (dstr->str_nok = sstr->str_nok)
  1518.           dstr->str_u.str_nval = sstr->str_u.str_nval;
  1519.       else {
  1520. ***************
  1521. *** 556,561 ****
  1522. --- 562,568 ----
  1523.       *mid = '\0';
  1524.       bigstr->str_cur = mid - big;
  1525.       }
  1526. +     /*SUPPRESS 560*/
  1527.       else if (i = mid - big) {    /* faster from front */
  1528.       midend -= littlelen;
  1529.       mid = midend;
  1530. ***************
  1531. *** 709,719 ****
  1532. --- 716,728 ----
  1533.       (void)str_2ptr(str2);
  1534.   
  1535.       if (str1->str_cur < str2->str_cur) {
  1536. +     /*SUPPRESS 560*/
  1537.       if (retval = memcmp(str1->str_ptr, str2->str_ptr, str1->str_cur))
  1538.           return retval < 0 ? -1 : 1;
  1539.       else
  1540.           return -1;
  1541.       }
  1542. +     /*SUPPRESS 560*/
  1543.       else if (retval = memcmp(str1->str_ptr, str2->str_ptr, str2->str_cur))
  1544.       return retval < 0 ? -1 : 1;
  1545.       else if (str1->str_cur == str2->str_cur)
  1546. ***************
  1547. *** 742,748 ****
  1548.       cnt = fp->_cnt;            /* get count into register */
  1549.       str->str_nok = 0;            /* invalidate number */
  1550.       str->str_pok = 1;            /* validate pointer */
  1551. !     if (str->str_len <= cnt + 1) {    /* make sure we have the room */
  1552.       if (cnt > 80 && str->str_len > append) {
  1553.           shortbuffered = cnt - str->str_len + append + 1;
  1554.           cnt -= shortbuffered;
  1555. --- 751,757 ----
  1556.       cnt = fp->_cnt;            /* get count into register */
  1557.       str->str_nok = 0;            /* invalidate number */
  1558.       str->str_pok = 1;            /* validate pointer */
  1559. !     if (str->str_len - append <= cnt + 1) { /* make sure we have the room */
  1560.       if (cnt > 80 && str->str_len > append) {
  1561.           shortbuffered = cnt - str->str_len + append + 1;
  1562.           cnt -= shortbuffered;
  1563. ***************
  1564. *** 928,941 ****
  1565.       if (*s == '\\' && s[1] && index("$@[{\\]}lLuUE",s[1])) {
  1566.           str_ncat(str, t, s - t);
  1567.           ++s;
  1568. !         if (isalpha(*s)) {
  1569.           str_ncat(str, "$c", 2);
  1570.           sawcase = (*s != 'E');
  1571.           }
  1572.           else {
  1573. !         if (*nointrp && s+1 < send)
  1574. !             if (*s != '@' && (*s != '$' || index(nointrp,s[1])))
  1575.               str_ncat(str,s-1,1);
  1576.           str_ncat(str, "$b", 2);
  1577.           }
  1578.           str_ncat(str, s, 1);
  1579. --- 937,957 ----
  1580.       if (*s == '\\' && s[1] && index("$@[{\\]}lLuUE",s[1])) {
  1581.           str_ncat(str, t, s - t);
  1582.           ++s;
  1583. !         if (isALPHA(*s)) {
  1584.           str_ncat(str, "$c", 2);
  1585.           sawcase = (*s != 'E');
  1586.           }
  1587.           else {
  1588. !         if (*nointrp) {        /* in a regular expression */
  1589. !             if (*s == '@')    /* always strip \@ */ /*SUPPRESS 530*/
  1590. !             ;
  1591. !             else if (*s == '$') {
  1592. !             if (s+1 >= send || index(nointrp, s[1]))
  1593. !                 str_ncat(str,s-1,1); /* only strip \$ for vars */
  1594. !             }
  1595. !             else        /* don't strip \\, \[, \{ etc. */
  1596.               str_ncat(str,s-1,1);
  1597. +         }
  1598.           str_ncat(str, "$b", 2);
  1599.           }
  1600.           str_ncat(str, s, 1);
  1601. ***************
  1602. *** 952,958 ****
  1603.       else if ((*s == '@' || *s == '$') && s+1 < send) {
  1604.           str_ncat(str,t,s-t);
  1605.           t = s;
  1606. !         if (*s == '$' && s[1] == '#' && (isalpha(s[2]) || s[2] == '_'))
  1607.           s++;
  1608.           s = scanident(s,send,tokenbuf);
  1609.           if (*t == '@' &&
  1610. --- 968,974 ----
  1611.       else if ((*s == '@' || *s == '$') && s+1 < send) {
  1612.           str_ncat(str,t,s-t);
  1613.           t = s;
  1614. !         if (*s == '$' && s[1] == '#' && (isALPHA(s[2]) || s[2] == '_'))
  1615.           s++;
  1616.           s = scanident(s,send,tokenbuf);
  1617.           if (*t == '@' &&
  1618. ***************
  1619. *** 988,993 ****
  1620. --- 1004,1010 ----
  1621.               case '\'':
  1622.               case '"':
  1623.               if (s[-1] != '$') {
  1624. +                 /*SUPPRESS 68*/
  1625.                   s = cpytill(tokenbuf,s+1,send,*s,&len);
  1626.                   if (s >= send)
  1627.                   fatal("Unterminated string");
  1628. ***************
  1629. *** 1002,1011 ****
  1630.               d = checkpoint;
  1631.               if (*d == '{' && s[-1] == '}') {    /* maybe {n,m} */
  1632.               ++d;
  1633. !             if (isdigit(*d)) {    /* matches /^{\d,?\d*}$/ */
  1634.                   if (*++d == ',')
  1635.                   ++d;
  1636. !                 while (isdigit(*d))
  1637.                   d++;
  1638.                   if (d == s - 1)
  1639.                   s = checkpoint;        /* Is {n,m}! Backoff! */
  1640. --- 1019,1028 ----
  1641.               d = checkpoint;
  1642.               if (*d == '{' && s[-1] == '}') {    /* maybe {n,m} */
  1643.               ++d;
  1644. !             if (isDIGIT(*d)) {    /* matches /^{\d,?\d*}$/ */
  1645.                   if (*++d == ',')
  1646.                   ++d;
  1647. !                 while (isDIGIT(*d))
  1648.                   d++;
  1649.                   if (d == s - 1)
  1650.                   s = checkpoint;        /* Is {n,m}! Backoff! */
  1651. ***************
  1652. *** 1022,1030 ****
  1653.                   weight += 150;
  1654.               else if (d[1] == '$')
  1655.                   weight -= 3;
  1656. !             if (isdigit(d[1])) {
  1657.                   if (d[2]) {
  1658. !                 if (isdigit(d[2]) && !d[3])
  1659.                       weight -= 10;
  1660.                   }
  1661.                   else
  1662. --- 1039,1047 ----
  1663.                   weight += 150;
  1664.               else if (d[1] == '$')
  1665.                   weight -= 3;
  1666. !             if (isDIGIT(d[1])) {
  1667.                   if (d[2]) {
  1668. !                 if (isDIGIT(d[2]) && !d[3])
  1669.                       weight -= 10;
  1670.                   }
  1671.                   else
  1672. ***************
  1673. *** 1037,1044 ****
  1674.                   case '&':
  1675.                   case '$':
  1676.                   weight -= seen[un_char] * 10;
  1677. !                 if (isalpha(d[1]) || isdigit(d[1]) ||
  1678. !                   d[1] == '_') {
  1679.                       d = scanident(d,s,tokenbuf);
  1680.                       if (stabent(tokenbuf,FALSE))
  1681.                       weight -= 100;
  1682. --- 1054,1060 ----
  1683.                   case '&':
  1684.                   case '$':
  1685.                   weight -= seen[un_char] * 10;
  1686. !                 if (isALNUM(d[1])) {
  1687.                       d = scanident(d,s,tokenbuf);
  1688.                       if (stabent(tokenbuf,FALSE))
  1689.                       weight -= 100;
  1690. ***************
  1691. *** 1062,1070 ****
  1692.                       weight += 1;
  1693.                       else if (index("rnftb",d[1]))
  1694.                       weight += 40;
  1695. !                     else if (isdigit(d[1])) {
  1696.                       weight += 40;
  1697. !                     while (d[1] && isdigit(d[1]))
  1698.                           d++;
  1699.                       }
  1700.                   }
  1701. --- 1078,1086 ----
  1702.                       weight += 1;
  1703.                       else if (index("rnftb",d[1]))
  1704.                       weight += 40;
  1705. !                     else if (isDIGIT(d[1])) {
  1706.                       weight += 40;
  1707. !                     while (d[1] && isDIGIT(d[1]))
  1708.                           d++;
  1709.                       }
  1710.                   }
  1711. ***************
  1712. *** 1082,1088 ****
  1713.                   else
  1714.                       weight -= 1;
  1715.                   default:
  1716. !                 if (isalpha(*d) && d[1] && isalpha(d[1])) {
  1717.                       bufptr = d;
  1718.                       if (yylex() != WORD)
  1719.                       weight -= 150;
  1720. --- 1098,1104 ----
  1721.                   else
  1722.                       weight -= 1;
  1723.                   default:
  1724. !                 if (isALPHA(*d) && d[1] && isALPHA(d[1])) {
  1725.                       bufptr = d;
  1726.                       if (yylex() != WORD)
  1727.                       weight -= 150;
  1728. ***************
  1729. *** 1243,1249 ****
  1730.   register char *send;
  1731.   {
  1732.       while (s < send) {
  1733. !     if (isascii(*s) && islower(*s))
  1734.           *s = toupper(*s);
  1735.       s++;
  1736.       }
  1737. --- 1259,1265 ----
  1738.   register char *send;
  1739.   {
  1740.       while (s < send) {
  1741. !     if (isLOWER(*s))
  1742.           *s = toupper(*s);
  1743.       s++;
  1744.       }
  1745. ***************
  1746. *** 1254,1260 ****
  1747.   register char *send;
  1748.   {
  1749.       while (s < send) {
  1750. !     if (isascii(*s) && isupper(*s))
  1751.           *s = tolower(*s);
  1752.       s++;
  1753.       }
  1754. --- 1270,1276 ----
  1755.   register char *send;
  1756.   {
  1757.       while (s < send) {
  1758. !     if (isUPPER(*s))
  1759.           *s = tolower(*s);
  1760.       s++;
  1761.       }
  1762. ***************
  1763. *** 1280,1287 ****
  1764.       return;
  1765.       }
  1766.       d = str->str_ptr;
  1767. !     while (isalpha(*d)) d++;
  1768. !     while (isdigit(*d)) d++;
  1769.       if (*d) {
  1770.           str_numset(str,atof(str->str_ptr) + 1.0);  /* punt */
  1771.       return;
  1772. --- 1296,1303 ----
  1773.       return;
  1774.       }
  1775.       d = str->str_ptr;
  1776. !     while (isALPHA(*d)) d++;
  1777. !     while (isDIGIT(*d)) d++;
  1778.       if (*d) {
  1779.           str_numset(str,atof(str->str_ptr) + 1.0);  /* punt */
  1780.       return;
  1781. ***************
  1782. *** 1288,1294 ****
  1783.       }
  1784.       d--;
  1785.       while (d >= str->str_ptr) {
  1786. !     if (isdigit(*d)) {
  1787.           if (++*d <= '9')
  1788.           return;
  1789.           *(d--) = '0';
  1790. --- 1304,1310 ----
  1791.       }
  1792.       d--;
  1793.       while (d >= str->str_ptr) {
  1794. !     if (isDIGIT(*d)) {
  1795.           if (++*d <= '9')
  1796.           return;
  1797.           *(d--) = '0';
  1798. ***************
  1799. *** 1295,1301 ****
  1800.       }
  1801.       else {
  1802.           ++*d;
  1803. !         if (isalpha(*d))
  1804.           return;
  1805.           *(d--) -= 'z' - 'a' + 1;
  1806.       }
  1807. --- 1311,1317 ----
  1808.       }
  1809.       else {
  1810.           ++*d;
  1811. !         if (isALPHA(*d))
  1812.           return;
  1813.           *(d--) -= 'z' - 'a' + 1;
  1814.       }
  1815. ***************
  1816. *** 1305,1311 ****
  1817.       str->str_cur++;
  1818.       for (d = str->str_ptr + str->str_cur; d > str->str_ptr; d--)
  1819.       *d = d[-1];
  1820. !     if (isdigit(d[1]))
  1821.       *d = '1';
  1822.       else
  1823.       *d = d[1];
  1824. --- 1321,1327 ----
  1825.       str->str_cur++;
  1826.       for (d = str->str_ptr + str->str_cur; d > str->str_ptr; d--)
  1827.       *d = d[-1];
  1828. !     if (isDIGIT(d[1]))
  1829.       *d = '1';
  1830.       else
  1831.       *d = d[1];
  1832.  
  1833. *** End of Patch 16 ***
  1834. exit 0 # Just in case...
  1835. -- 
  1836. Kent Landfield                   INTERNET: kent@sparky.IMD.Sterling.COM
  1837. Sterling Software, IMD           UUCP:     uunet!sparky!kent
  1838. Phone:    (402) 291-8300         FAX:      (402) 291-4362
  1839. Please send comp.sources.misc-related mail to kent@uunet.uu.net.
  1840.