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

Diff for /src/usr.bin/mail/main.c between version 1.24 and 1.25

version 1.24, 2014/11/24 20:01:43 version 1.25, 2014/11/24 20:03:33
Line 111 
Line 111 
                         /*                          /*
                          * User is specifying file to "edit" with Mail,                           * User is specifying file to "edit" with Mail,
                          * as opposed to reading system mailbox.                           * as opposed to reading system mailbox.
                          * If no argument is given after -f, we read his                           * We read his mbox file unless another file
                          * mbox file.                           * is specified after the arguments.
                          *  
                          * getopt() can't handle optional arguments, so here  
                          * is an ugly hack to get around it.  
                          */                           */
                         if ((argv[optind]) && (argv[optind][0] != '-'))                          ef = "&";
                                 ef = argv[optind++];  
                         else  
                                 ef = "&";  
                         break;                          break;
                 case 'n':                  case 'n':
                         /*                          /*
Line 169 
Line 163 
                         /*NOTREACHED*/                          /*NOTREACHED*/
                 }                  }
         }          }
         for (i = optind; (argv[i]) && (*argv[i] != '-'); i++)          if (ef != NULL) {
                 to = cat(to, nalloc(argv[i], GTO));                  /* Check for optional mailbox file name. */
         for (; argv[i]; i++)                  if (optind < argc) {
                 smopts = cat(smopts, nalloc(argv[i], 0));                          ef = argv[optind++];
                           if (optind < argc)
                               errx(1, "Cannot give -f and people to send to");
                   }
           } else {
                   for (i = optind; (argv[i]) && (*argv[i] != '-'); i++)
                           to = cat(to, nalloc(argv[i], GTO));
                   for (; argv[i]; i++)
                           smopts = cat(smopts, nalloc(argv[i], 0));
           }
         /*          /*
          * Check for inconsistent arguments.           * Check for inconsistent arguments.
          */           */
         if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL))          if (to == NULL && (subject != NULL || cc != NULL || bcc != NULL))
                 errx(1, "You must specify direct recipients with -s, -c, or -b");                  errx(1, "You must specify direct recipients with -s, -c, or -b");
         if (ef != NULL && to != NULL)  
                 errx(1, "Cannot give -f and people to send to");  
         /*          /*
          * Block SIGINT except where we install an explicit handler for it.           * Block SIGINT except where we install an explicit handler for it.
          */           */

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25