home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / misc / volume2 / smail-xenix-v3 / execm.c next >
Encoding:
C/C++ Source or Header  |  1991-08-07  |  747 b   |  45 lines

  1. /*
  2.  * execm.c
  3.  *
  4.  * This program is a substitute for Xenix's /usr/lib/mail/execmail.
  5.  *
  6.  * Written by Chip Salzenberg (chip@ateng.UUCP).
  7.  * Released to Usenet on 01 Dec 1987.
  8.  *
  9.  * Do what you want with it; I'm not responsible for lost mail,
  10.  * but I don't expect that this little program will lose anything.
  11.  */
  12.  
  13. #include <stdio.h>
  14.  
  15. main(argc, argv)
  16. int     argc;
  17. char    **argv;
  18. {
  19.     char *progname = argv[0];
  20.  
  21.     /*
  22.      * Drop the execmail options.
  23.      */
  24.     while (argv[1][0] == '-')
  25.     {
  26.         switch (argv[1][1])
  27.         {
  28.         case 'f':
  29.         case 'h':
  30.             argv += 2;
  31.             break;
  32.         default:
  33.             ++argv;
  34.             break;
  35.         }
  36.     }
  37.  
  38.     argv[0] = progname;
  39.     execv("/usr/bin/smail", argv);
  40.     execv("/bin/smail", argv);
  41.  
  42.     fprintf(stderr, "%s: can't execute smail!\n", progname);
  43.     exit(1);
  44. }
  45.