home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 3 / 3218 < prev    next >
Encoding:
Internet Message Format  |  1991-04-20  |  3.2 KB

  1. From: skrenta@blekko.commodore.com (Rich Skrenta)
  2. Newsgroups: alt.sources
  3. Subject: Important Tass patch
  4. Message-ID: <165@blekko.commodore.com>
  5. Date: 19 Apr 91 18:30:40 GMT
  6.  
  7. [I sent out a bogus patch this morning.  If you've applied it, undo it
  8. before applying this one.  Sorry]
  9.  
  10. Tass 3.2 will croak if it sees an article and can't find a From: or Subject:
  11. line in it.  The following patch should fix this, as well as a delete/backspace
  12. bug.
  13.  
  14. *** art.c-    Wed Apr 17 20:01:51 1991
  15. --- art.c    Fri Apr 19 14:12:06 1991
  16. ***************
  17. *** 328,335 ****
  18.   
  19.       buf[n - 1] = '\0';
  20.   
  21. !     h->subject = "<no subject>";
  22. !     h->from = "<no from>";
  23.   
  24.       p = buf;
  25.       while (1) {
  26. --- 328,335 ----
  27.   
  28.       buf[n - 1] = '\0';
  29.   
  30. !     h->subject = "";
  31. !     h->from = "";
  32.   
  33.       p = buf;
  34.       while (1) {
  35. ***************
  36. *** 391,398 ****
  37.               iptr = (int *) arts[i].subject;
  38.               iptr--;
  39.   
  40. !             if (*iptr < 0) {
  41.                   fprintf(fp, " %s\n", arts[i].subject);
  42.                   *iptr = realnum;
  43.               } else
  44.                   fprintf(fp, "%%%d\n", *iptr);
  45. --- 391,400 ----
  46.               iptr = (int *) arts[i].subject;
  47.               iptr--;
  48.   
  49. !             if (arts[i].subject[0] == '\0')
  50.                   fprintf(fp, " %s\n", arts[i].subject);
  51. +             else if (*iptr < 0) {
  52. +                 fprintf(fp, " %s\n", arts[i].subject);
  53.                   *iptr = realnum;
  54.               } else
  55.                   fprintf(fp, "%%%d\n", *iptr);
  56. ***************
  57. *** 400,406 ****
  58.               iptr = (int *) arts[i].from;
  59.               iptr--;
  60.   
  61. !             if (*iptr < 0) {
  62.                   fprintf(fp, " %s\n", arts[i].from);
  63.                   *iptr = realnum;
  64.               } else
  65. --- 402,410 ----
  66.               iptr = (int *) arts[i].from;
  67.               iptr--;
  68.   
  69. !             if (arts[i].from[0] == '\0')
  70. !                 fprintf(fp, " %s\n", arts[i].from);
  71. !             else if (*iptr < 0) {
  72.                   fprintf(fp, " %s\n", arts[i].from);
  73.                   *iptr = realnum;
  74.               } else
  75. *** prompt.c-    Wed Apr 17 20:01:58 1991
  76. --- prompt.c    Fri Apr 19 10:00:02 1991
  77. ***************
  78. *** 26,36 ****
  79.       len = 1;
  80.       ch = ReadCh();
  81.       while (ch != '\n'&& ch != '\r') {
  82. !         if (ch >= '0' && ch <= '9' && len < 4) {
  83. !             buf[len++] = ch;
  84. !             buf[len] = '\0';
  85. !             putchar(ch);
  86. !         } else if (ch == 8 || ch == 127) {
  87.               if (len) {
  88.                   len--;
  89.                   buf[len] = '\0';
  90. --- 26,32 ----
  91.       len = 1;
  92.       ch = ReadCh();
  93.       while (ch != '\n'&& ch != '\r') {
  94. !         if (ch == 8 || ch == 127) {
  95.               if (len) {
  96.                   len--;
  97.                   buf[len] = '\0';
  98. ***************
  99. *** 50,55 ****
  100. --- 46,55 ----
  101.               }
  102.               buf[0] = '\0';
  103.               len = 0;
  104. +         } else if (ch >= '0' && ch <= '9' && len < 4) {
  105. +             buf[len++] = ch;
  106. +             buf[len] = '\0';
  107. +             putchar(ch);
  108.           } else
  109.               putchar(7);
  110.           fflush(stdout);
  111. ***************
  112. *** 89,99 ****
  113.       len = 0;
  114.       ch = ReadCh();
  115.       while (ch != '\n' && ch != '\r') {
  116. !         if (ch >= ' ' && len < 60) {
  117. !             buf[len++] = ch;
  118. !             buf[len] = '\0';
  119. !             putchar(ch);
  120. !         } else if (ch == 8 || ch == 127) {
  121.               if (len) {
  122.                   len--;
  123.                   buf[len] = '\0';
  124. --- 89,95 ----
  125.       len = 0;
  126.       ch = ReadCh();
  127.       while (ch != '\n' && ch != '\r') {
  128. !         if (ch == 8 || ch == 127) {
  129.               if (len) {
  130.                   len--;
  131.                   buf[len] = '\0';
  132. ***************
  133. *** 113,118 ****
  134. --- 109,118 ----
  135.               }
  136.               buf[0] = '\0';
  137.               len = 0;
  138. +         } else if (ch >= ' ' && len < 60) {
  139. +             buf[len++] = ch;
  140. +             buf[len] = '\0';
  141. +             putchar(ch);
  142.           } else
  143.               putchar(7);
  144.           fflush(stdout);
  145.  
  146. --
  147. skrenta@blekko.commodore.com
  148.