home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume14 / mn / patch01 / patch1 next >
Encoding:
Text File  |  1990-09-15  |  2.8 KB  |  90 lines

  1. *** postd/mn.c    Thu Aug 23 18:16:31 1990
  2. --- mn.c    Thu Aug 23 18:33:32 1990
  3. ***************
  4. *** 5,10
  5.   of output, mainly for human consumption.
  6.   
  7.   */
  8.   /*
  9.       options:
  10.   
  11.  
  12. --- 5,11 -----
  13.   of output, mainly for human consumption.
  14.   
  15.   */
  16. + /* Version:1  Patchlevel:1 */
  17.   /*
  18.       options:
  19.   
  20. ***************
  21. *** 56,61
  22.   
  23.   extern char *index(), *rindex(), *malloc();   /* minimal header files? */
  24.   char *dynamicize();
  25.   
  26.   main(argc, argv)  int argc; char **argv;
  27.   {int state;         /* 0 = waiting for 'from', 1=in header, 2=in body */
  28.  
  29. --- 57,63 -----
  30.   
  31.   extern char *index(), *rindex(), *malloc();   /* minimal header files? */
  32.   char *dynamicize();
  33. + static char *nullsub = "";
  34.   
  35.   main(argc, argv)  int argc; char **argv;
  36.   {int state;         /* 0 = waiting for 'from', 1=in header, 2=in body */
  37. ***************
  38. *** 197,202
  39.          ; /* search for first blank */
  40.       buf[i] = (char)0;  /* terminate the string there */
  41.       from = dynamicize(buf+FROMOFF);
  42.      }
  43.      if(state==1 && !(style==OFROM || style==ADDRONLY) &&
  44.          !strncmp("Subject:", buf, SUBOFF)) /* grab the subj string */
  45.  
  46. --- 199,206 -----
  47.          ; /* search for first blank */
  48.       buf[i] = (char)0;  /* terminate the string there */
  49.       from = dynamicize(buf+FROMOFF);
  50. +     if(sub) free(sub);     /* don't reuse old subject lines */ 
  51. +     sub = NULL;
  52.      }
  53.      if(state==1 && !(style==OFROM || style==ADDRONLY) &&
  54.          !strncmp("Subject:", buf, SUBOFF)) /* grab the subj string */
  55. ***************
  56. *** 237,242
  57.       if(!index(buf+STATOFF, 'R'))  /* read mail? */
  58.        unread++;  else tych = (tych == 'U')?'O':'?';
  59.   
  60.       switch(style)   /* output this msg. in correct style */
  61.       {
  62.        case SIMPLE:
  63.  
  64. --- 241,248 -----
  65.       if(!index(buf+STATOFF, 'R'))  /* read mail? */
  66.        unread++;  else tych = (tych == 'U')?'O':'?';
  67.   
  68. +     if(!sub) sub = nullsub;  /* non-dynamic null string to ease output */
  69. +     /* should be reset to NULL after output so as not to be freed */
  70.       switch(style)   /* output this msg. in correct style */
  71.       {
  72.        case SIMPLE:
  73. ***************
  74. *** 290,295
  75.        default:
  76.         puts("Unimplemented style"); break;  /* this should never happen ;-) */
  77.       }  /* end of style-output switch() */
  78.      }  /* end of if(Status:) test */
  79.      if(remains > 0 && (state == 0 || state == 2)) /*need to fill rest of line?*/
  80.      {char *cp; int spflag = 0;    /* stick this line onto end of line */
  81.  
  82. --- 296,302 -----
  83.        default:
  84.         puts("Unimplemented style"); break;  /* this should never happen ;-) */
  85.       }  /* end of style-output switch() */
  86. +     if(sub == nullsub) sub = NULL;  /* reset null sub. to NULL again */
  87.      }  /* end of if(Status:) test */
  88.      if(remains > 0 && (state == 0 || state == 2)) /*need to fill rest of line?*/
  89.      {char *cp; int spflag = 0;    /* stick this line onto end of line */
  90.