home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / sun / volume3 / catcher / patch01 / patch
Encoding:
Text File  |  1991-05-14  |  8.2 KB  |  281 lines

  1. *** Makefile.orig    Tue Jan 29 12:39:44 1991
  2. --- Makefile    Tue Jan 22 07:32:58 1991
  3. ***************
  4. *** 43,49 ****
  5.   install: catcher $(MAN)/catcher.$(MANEXT)
  6.       cp catcher $(BIN)
  7.       chmod 755 $(BIN)/catcher
  8. -     cp catcher.info $(HELPDIR)
  9.   
  10.   $(MAN)/catcher.$(MANEXT): catcher.man
  11.       cp -p catcher.man $(MAN)/catcher.$(MANEXT)
  12. --- 43,48 ----
  13. *** Imakefile.orig    Tue Jan 29 12:39:47 1991
  14. --- Imakefile    Tue Jan 22 07:32:57 1991
  15. ***************
  16. *** 20,26 ****
  17.   ComplexProgramTarget(catcher)
  18.   
  19.   install:: install.man
  20. -     $(INSTALL) -c $(INSTMANFLAGS) catcher.info $(HELPDIR)/catcher.info
  21.   
  22.   manual:
  23.       cd doc; make PRINT="$(PRINT)" PRINTER="$(PRINTER)" manual
  24. --- 20,25 ----
  25. *** README.orig    Tue Jan 29 12:39:47 1991
  26. --- README    Tue Jan 29 12:37:00 1991
  27. ***************
  28. *** 107,109 ****
  29. --- 107,115 ----
  30.   *********************************************************************************
  31.   
  32.            1.0    16 Jan 91    Original release
  33. +      
  34. +          1.0a    29 Jan 91    Patch 1
  35. +                      Fixed Imakefile
  36. +                      Corrected bug in parser
  37. +                      Corrected handling of suffix string
  38. +                      Renamed ungetc to last_char in lex.c
  39. *** lex.c.orig    Tue Jan 29 12:39:53 1991
  40. --- lex.c    Tue Jan 29 12:33:55 1991
  41. ***************
  42. *** 52,59 ****
  43.                    {"value",        VALUE},
  44.                    {"window",       WINDOW_}};
  45.   
  46.   PRIVATE    struct    {char    first;
  47.            char    next;
  48.            int    name;
  49. --- 52,57 ----
  50. ***************
  51. *** 73,85 ****
  52.          curr_file = "stdin";
  53.          f = stdin;
  54.          line_count = 1;
  55. !        ungetc = -1;
  56.          return(TRUE);
  57.          }
  58.       else if (f = fopen(path, "r")) {
  59.          curr_file = strsave(path);
  60.          line_count = 1;
  61. !        ungetc = -1;
  62.          return(TRUE);
  63.          }
  64.       else
  65. --- 71,83 ----
  66.          curr_file = "stdin";
  67.          f = stdin;
  68.          line_count = 1;
  69. !        last_char = -1;
  70.          return(TRUE);
  71.          }
  72.       else if (f = fopen(path, "r")) {
  73.          curr_file = strsave(path);
  74.          line_count = 1;
  75. !        last_char = -1;
  76.          return(TRUE);
  77.          }
  78.       else
  79. ***************
  80. *** 92,99 ****
  81.   {    register    char    c;
  82.       static        int    first = TRUE;
  83.   
  84. !     if (ungetc != -1)
  85. !        c = ungetc, ungetc = -1;
  86.       else if (f == NULL)
  87.          return(EOF);
  88.       else {
  89. --- 90,97 ----
  90.   {    register    char    c;
  91.       static        int    first = TRUE;
  92.   
  93. !     if (last_char != -1)
  94. !        c = last_char, last_char = -1;
  95.       else if (f == NULL)
  96.          return(EOF);
  97.       else {
  98. ***************
  99. *** 182,188 ****
  100.          *p++ = c;
  101.          while (isalnum(c = getch()) || c == '_')
  102.             *p++ = c;
  103. !        ungetc = c;
  104.          *p = '\0';
  105.          temp = strsave(buf);
  106.          for (p = buf; *p; p++)
  107. --- 180,186 ----
  108.          *p++ = c;
  109.          while (isalnum(c = getch()) || c == '_')
  110.             *p++ = c;
  111. !        last_char = c;
  112.          *p = '\0';
  113.          temp = strsave(buf);
  114.          for (p = buf; *p; p++)
  115. ***************
  116. *** 220,226 ****
  117.          while (isdigit(c = getch()))
  118.             *p++ = c;
  119.          *p = '\0';
  120. !        ungetc = c;
  121.          yylval.ival = atoi(buf);
  122.          RETURN(INTEGER);
  123.          }
  124. --- 218,224 ----
  125.          while (isdigit(c = getch()))
  126.             *p++ = c;
  127.          *p = '\0';
  128. !        last_char = c;
  129.          yylval.ival = atoi(buf);
  130.          RETURN(INTEGER);
  131.          }
  132. ***************
  133. *** 240,246 ****
  134.                for (c1 = getch(), j = 1; punc[i + j].first == c; j++)
  135.                   if (c1 == punc[i + j].next)
  136.                      RETURN(punc[i + j].name);
  137. !              ungetc = c1;
  138.                RETURN(punc[i].name);
  139.                }
  140.          yyerror("Invalid character in source file: %c (0x%02x)", c, c);
  141. --- 238,244 ----
  142.                for (c1 = getch(), j = 1; punc[i + j].first == c; j++)
  143.                   if (c1 == punc[i + j].next)
  144.                      RETURN(punc[i + j].name);
  145. !              last_char = c1;
  146.                RETURN(punc[i].name);
  147.                }
  148.          yyerror("Invalid character in source file: %c (0x%02x)", c, c);
  149. *** parse.y.orig    Tue Jan 29 12:39:58 1991
  150. --- parse.y    Tue Jan 29 12:33:56 1991
  151. ***************
  152. *** 30,42 ****
  153.   
  154.   EXPORT    int    parse_errors_occured;
  155.   
  156. ! EXPORT    Catch    config = {NULL, NULL, "Catcher", NULL, '$', '{', '}', NULL, NULL};
  157.   
  158.   PRIVATE    char    *get_last_token();
  159.   
  160.   PRIVATE    char    *curr_file;
  161.   PRIVATE    int    line_count = 1;
  162. ! PRIVATE    char    ungetc = -1;
  163.   
  164.   PRIVATE    Command    *curr_cmd;
  165.   PRIVATE    Option    *curr_opt;
  166. --- 30,42 ----
  167.   
  168.   EXPORT    int    parse_errors_occured;
  169.   
  170. ! EXPORT    Catch    config = {NULL, NULL, "Catcher 1.0a", NULL, '$', '{', '}', NULL, NULL};
  171.   
  172.   PRIVATE    char    *get_last_token();
  173.   
  174.   PRIVATE    char    *curr_file;
  175.   PRIVATE    int    line_count = 1;
  176. ! PRIVATE    char    last_char = -1;
  177.   
  178.   PRIVATE    Command    *curr_cmd;
  179.   PRIVATE    Option    *curr_opt;
  180. ***************
  181. *** 59,66 ****
  182.   
  183.   %token        LBRACE RBRACE
  184.   
  185. ! %token        BY CHOICE COMMAND DEFAULT DELIMITER EXCLUSIVE FINISH HORIZONTAL ICON_ ICON_MASK INIT LABEL
  186. ! %token        MESSAGE NONEXCLUSIVE NUMERIC OPTIONAL OUTPUT PARAMETER START SUFFIX TEXT TO VALUE WINDOW_
  187.   
  188.   %type    <chval>    anon_choice choice
  189.   %type    <cpval>    command_name delimiter icon icon_mask label message suffix text_init value
  190. --- 59,66 ----
  191.   
  192.   %token        LBRACE RBRACE
  193.   
  194. ! %token        BY CHOICE COMMAND DEFAULT DELIMITER EXCLUSIVE HORIZONTAL ICON_ ICON_MASK INIT LABEL
  195. ! %token        MESSAGE NONEXCLUSIVE NUMERIC OPTIONAL OUTPUT PARAMETER SUFFIX TEXT TO VALUE WINDOW_
  196.   
  197.   %type    <chval>    anon_choice choice
  198.   %type    <cpval>    command_name delimiter icon icon_mask label message suffix text_init value
  199. ***************
  200. *** 383,389 ****
  201.   
  202.   {    char    buf1[1024], buf2[1024];
  203.   
  204. !     sprintf(buf1, "%s: line %d: ", curr_file, line_count - ((ungetc == '\n')? 1 : 0));
  205.       sprintf(buf2, s1, s2, s3, s4, s5, s6, s7);
  206.       strcat(buf1, buf2);
  207.       if (strcmp(s1, "syntax error") == 0) {
  208. --- 383,389 ----
  209.   
  210.   {    char    buf1[1024], buf2[1024];
  211.   
  212. !     sprintf(buf1, "%s: line %d: ", curr_file, line_count - ((last_char == '\n')? 1 : 0));
  213.       sprintf(buf2, s1, s2, s3, s4, s5, s6, s7);
  214.       strcat(buf1, buf2);
  215.       if (strcmp(s1, "syntax error") == 0) {
  216. *** patchlevel.h.orig    Tue Jan 29 12:40:00 1991
  217. --- patchlevel.h    Tue Jan 29 12:11:30 1991
  218. ***************
  219. *** 0 ****
  220. --- 1,29 ----
  221. + /************************************************************************/
  222. + /*    Copyright 1987-1991 by Chuck Musciano and Harris Corporation     */
  223. + /*                                    */
  224. + /*    Full ownership of this software, and all rights pertaining to     */
  225. + /*    the for-profit distribution of this software, are retained by     */
  226. + /*    Chuck Musciano and Harris Corporation.  You are permitted to     */
  227. + /*    use this software without fee.  This software is provided "as     */
  228. + /*    is" without express or implied warranty.  You may redistribute     */
  229. + /*    this software, provided that this copyright notice is retained,    */
  230. + /*    and that the software is not distributed for profit.  If you     */
  231. + /*    wish to use this software in a profit-making venture, you must     */
  232. + /*    first license this code and its underlying technology from     */
  233. + /*    Harris Corporation.                         */
  234. + /*                                    */
  235. + /*    Bottom line: you can have this software, you can use it, you     */
  236. + /*    can give it away.  You just can't sell any or all parts of it     */
  237. + /*    without prior permission from Harris Corporation.         */
  238. + /************************************************************************/
  239. + /************************************************************************/
  240. + /*                                    */
  241. + /*    Patch        Comments                    */
  242. + /*      0        Initial release                    */
  243. + /*               comp.sources.x: Volume 11, Issues 6-10    */
  244. + /*                                    */
  245. + /*      1        Bug fixes; see README for details        */
  246. + /*               comp.sources.x: Volume 11, Issue ?        */
  247. + /*                                    */
  248. + /************************************************************************/
  249. *** process.c.orig    Tue Jan 29 12:40:01 1991
  250. --- process.c    Tue Jan 29 12:33:57 1991
  251. ***************
  252. *** 340,350 ****
  253.   {    char    *path;
  254.       FILE    *f;
  255.   
  256. !     path = (char *) malloc(strlen(config.suffix) + 22);
  257.       strcpy(path, "/tmp/catcher.XXXXXX");
  258.       mktemp(path);
  259. !     strcat(path, ".");
  260. !     strcat(path, config.suffix);
  261.       if ((f = fopen(path, "w")) == NULL)
  262.          error("cannot open %s for writing: %s", path, sys_errlist[errno]);
  263.       else if (fwrite(data, 1, strlen(data), f) != strlen(data)) {
  264. --- 340,352 ----
  265.   {    char    *path;
  266.       FILE    *f;
  267.   
  268. !     path = (char *) malloc((config.suffix? strlen(config.suffix) : 0) + 22);
  269.       strcpy(path, "/tmp/catcher.XXXXXX");
  270.       mktemp(path);
  271. !     if (config.suffix) {
  272. !        strcat(path, ".");
  273. !        strcat(path, config.suffix);
  274. !        }
  275.       if ((f = fopen(path, "w")) == NULL)
  276.          error("cannot open %s for writing: %s", path, sys_errlist[errno]);
  277.       else if (fwrite(data, 1, strlen(data), f) != strlen(data)) {
  278.