[BACK]Return to cmd1.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mail

Diff for /src/usr.bin/mail/cmd1.c between version 1.7 and 1.8

version 1.7, 1997/07/13 23:53:57 version 1.8, 1997/07/14 00:24:24
Line 146 
Line 146 
         int s;          int s;
         char *cp;          char *cp;
   
         if ((cp = value("screen")) != NOSTR && (s = atoi(cp)) > 0)          if ((cp = value("screen")) != NULL && (s = atoi(cp)) > 0)
                 return(s);                  return(s);
         return(screenheight - 4);          return(screenheight - 4);
 }  }
Line 186 
Line 186 
   
         mp = &message[mesg-1];          mp = &message[mesg-1];
         (void)readline(setinput(mp), headline, LINESIZE);          (void)readline(setinput(mp), headline, LINESIZE);
         if ((subjline = hfield("subject", mp)) == NOSTR)          if ((subjline = hfield("subject", mp)) == NULL)
                 subjline = hfield("subj", mp);                  subjline = hfield("subj", mp);
         /*          /*
          * Bletch!           * Bletch!
Line 206 
Line 206 
         parse(headline, &hl, pbuf);          parse(headline, &hl, pbuf);
         snprintf(wcount, sizeof(wcount), "%3d/%-5d", mp->m_lines, mp->m_size);          snprintf(wcount, sizeof(wcount), "%3d/%-5d", mp->m_lines, mp->m_size);
         subjlen = screenwidth - 50 - strlen(wcount);          subjlen = screenwidth - 50 - strlen(wcount);
         name = value("show-rcpt") != NOSTR ?          name = value("show-rcpt") != NULL ?
                 skin(hfield("to", mp)) : nameof(mp, 0);                  skin(hfield("to", mp)) : nameof(mp, 0);
         if (subjline == NOSTR || subjlen < 0)           /* pretty pathetic */          if (subjline == NULL || subjlen < 0)            /* pretty pathetic */
                 printf("%c%c%3d %-20.20s  %16.16s %s\n",                  printf("%c%c%3d %-20.20s  %16.16s %s\n",
                         curind, dispc, mesg, name, hl.l_date, wcount);                          curind, dispc, mesg, name, hl.l_date, wcount);
         else          else
Line 246 
Line 246 
                         putchar('\n');                          putchar('\n');
                         cc = strlen(cp->c_name) + 2;                          cc = strlen(cp->c_name) + 2;
                 }                  }
                 if ((cp+1)->c_name != NOSTR)                  if ((cp+1)->c_name != NULL)
                         printf("%s, ", cp->c_name);                          printf("%s, ", cp->c_name);
                 else                  else
                         puts(cp->c_name);                          puts(cp->c_name);
Line 304 
Line 304 
 /*  /*
  * Type out the messages requested.   * Type out the messages requested.
  */   */
 jmp_buf pipestop;  sigjmp_buf      pipestop;
 int  int
 type1(msgvec, doign, page)  type1(msgvec, doign, page)
         int *msgvec;          int *msgvec;
Line 316 
Line 316 
         int nlines;          int nlines;
         FILE *obuf;          FILE *obuf;
 #if __GNUC__  #if __GNUC__
         /* Avoid longjmp clobbering */          /* Avoid siglongjmp clobbering */
         (void)&cp;          (void)&cp;
         (void)&obuf;          (void)&obuf;
 #endif  #endif
   
         obuf = stdout;          obuf = stdout;
         if (setjmp(pipestop))          if (sigsetjmp(pipestop, 1))
                 goto close_pipe;                  goto close_pipe;
         if (value("interactive") != NOSTR &&          if (value("interactive") != NULL &&
             (page || (cp = value("crt")) != NOSTR)) {              (page || (cp = value("crt")) != NULL)) {
                 nlines = 0;                  nlines = 0;
                 if (!page) {                  if (!page) {
                         for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++)                          for (ip = msgvec; *ip && ip-msgvec < msgCount; ip++)
Line 347 
Line 347 
                 mp = &message[*ip - 1];                  mp = &message[*ip - 1];
                 touch(mp);                  touch(mp);
                 dot = mp;                  dot = mp;
                 if (value("quiet") == NOSTR)                  if (value("quiet") == NULL)
                         fprintf(obuf, "Message %d:\n", *ip);                          fprintf(obuf, "Message %d:\n", *ip);
                 (void)send(mp, obuf, doign ? ignore : 0, NOSTR);                  (void)send(mp, obuf, doign ? ignore : 0, NULL);
         }          }
 close_pipe:  close_pipe:
         if (obuf != stdout) {          if (obuf != stdout) {
Line 371 
Line 371 
 brokpipe(signo)  brokpipe(signo)
         int signo;          int signo;
 {  {
         longjmp(pipestop, 1);          siglongjmp(pipestop, 1);
 }  }
   
 /*  /*
Line 392 
Line 392 
   
         topl = 5;          topl = 5;
         valtop = value("toplines");          valtop = value("toplines");
         if (valtop != NOSTR) {          if (valtop != NULL) {
                 topl = atoi(valtop);                  topl = atoi(valtop);
                 if (topl < 0 || topl > 10000)                  if (topl < 0 || topl > 10000)
                         topl = 5;                          topl = 5;
Line 402 
Line 402 
                 mp = &message[*ip - 1];                  mp = &message[*ip - 1];
                 touch(mp);                  touch(mp);
                 dot = mp;                  dot = mp;
                 if (value("quiet") == NOSTR)                  if (value("quiet") == NULL)
                         printf("Message %d:\n", *ip);                          printf("Message %d:\n", *ip);
                 ibuf = setinput(mp);                  ibuf = setinput(mp);
                 c = mp->m_lines;                  c = mp->m_lines;
Line 469 
Line 469 
                 puts("No value set for \"folder\"");                  puts("No value set for \"folder\"");
                 return(1);                  return(1);
         }          }
         if ((cmd = value("LISTER")) == NOSTR)          if ((cmd = value("LISTER")) == NULL)
                 cmd = "ls";                  cmd = "ls";
         (void)run_command(cmd, 0, -1, -1, dirname, NOSTR, NOSTR);          (void)run_command(cmd, 0, -1, -1, dirname, NULL, NULL);
         return(0);          return(0);
 }  }
   

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8