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

Diff for /src/usr.bin/mail/cmd2.c between version 1.17 and 1.18

version 1.17, 2009/10/27 23:59:40 version 1.18, 2011/04/06 11:36:26
Line 53 
Line 53 
         int *msgvec = v;          int *msgvec = v;
         int *ip, *ip2, list[2], mdot;          int *ip, *ip2, list[2], mdot;
   
         if (*msgvec != NULL) {          if (*msgvec != 0) {
                 /*                  /*
                  * If some messages were supplied, find the                   * If some messages were supplied, find the
                  * first applicable one following dot using                   * first applicable one following dot using
Line 65 
Line 65 
                  * Find the first message in the supplied                   * Find the first message in the supplied
                  * message list which follows dot.                   * message list which follows dot.
                  */                   */
                 for (ip = msgvec; *ip != NULL; ip++)                  for (ip = msgvec; *ip != 0; ip++)
                         if (*ip > mdot)                          if (*ip > mdot)
                                 break;                                  break;
                 if (*ip == 0)                  if (*ip == 0)
Line 77 
Line 77 
                                 dot = mp;                                  dot = mp;
                                 goto hitit;                                  goto hitit;
                         }                          }
                         if (*ip2 != NULL)                          if (*ip2 != 0)
                                 ip2++;                                  ip2++;
                         if (*ip2 == 0)                          if (*ip2 == 0)
                                 ip2 = msgvec;                                  ip2 = msgvec;
Line 110 
Line 110 
          * Print dot.           * Print dot.
          */           */
         list[0] = dot - &message[0] + 1;          list[0] = dot - &message[0] + 1;
         list[1] = NULL;          list[1] = 0;
         return(type(list));          return(type(list));
 }  }
   
Line 158 
Line 158 
                         printf("No messages to %s.\n", cmd);                          printf("No messages to %s.\n", cmd);
                         return(1);                          return(1);
                 }                  }
                 msgvec[1] = NULL;                  msgvec[1] = 0;
         }          }
         if (f && getmsglist(str, msgvec, 0) < 0)          if (f && getmsglist(str, msgvec, 0) < 0)
                 return(1);                  return(1);
Line 271 
Line 271 
                 list[0] = dot - &message[0] + 1;                  list[0] = dot - &message[0] + 1;
                 if (list[0] > lastdot) {                  if (list[0] > lastdot) {
                         touch(dot);                          touch(dot);
                         list[1] = NULL;                          list[1] = 0;
                         return(type(list));                          return(type(list));
                 }                  }
                 puts("At EOF");                  puts("At EOF");
Line 291 
Line 291 
         struct message *mp;          struct message *mp;
         int *ip, last;          int *ip, last;
   
         last = NULL;          last = 0;
         for (ip = msgvec; *ip != NULL; ip++) {          for (ip = msgvec; *ip != 0; ip++) {
                 mp = &message[*ip - 1];                  mp = &message[*ip - 1];
                 touch(mp);                  touch(mp);
                 mp->m_flag |= MDELETED|MTOUCH;                  mp->m_flag |= MDELETED|MTOUCH;
                 mp->m_flag &= ~(MPRESERVE|MSAVED|MBOX);                  mp->m_flag &= ~(MPRESERVE|MSAVED|MBOX);
                 last = *ip;                  last = *ip;
         }          }
         if (last != NULL) {          if (last != 0) {
                 dot = &message[last-1];                  dot = &message[last-1];
                 last = first(0, MDELETED);                  last = first(0, MDELETED);
                 if (last != NULL) {                  if (last != 0) {
                         dot = &message[last-1];                          dot = &message[last-1];
                         return(0);                          return(0);
                 }                  }

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18