home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / LO241SRV.ZIP / startup.c < prev    next >
C/C++ Source or Header  |  1998-08-01  |  1KB  |  55 lines

  1.  
  2. // LoraBBS Version 2.41 Free Edition
  3. // Copyright (C) 1987-98 Marco Maccaferri
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License as published by
  7. // the Free Software Foundation; either version 2 of the License, or
  8. // (at your option) any later version.
  9. //
  10. // This program is distributed in the hope that it will be useful,
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. // GNU General Public License for more details.
  14. //
  15. // You should have received a copy of the GNU General Public License
  16. // along with this program; if not, write to the Free Software
  17. // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18.  
  19. #include <stdio.h>
  20. #include <dos.h>
  21. #include <conio.h>
  22. #include <string.h>
  23. #include <process.h>
  24. #include <alloc.h>
  25.  
  26. void main (argc, argv)
  27. int argc;
  28. char *argv[];
  29. {
  30.    int i;
  31.    char *p, argv0[80], *args[20], memf[10];
  32.  
  33.    sprintf (memf, "%ld", 0L);
  34.  
  35.    args[0] = argv0;
  36.    for (i = 1; i < argc; i++)
  37.       args[i] = argv[i];
  38.    args[i++] = memf;
  39.    args[i] = NULL;
  40.  
  41.    strcpy (argv0, argv[0]);
  42.    p = strstr (strupr (argv0), ".EXE");
  43.    if (p == NULL)
  44.       strcat (argv0, ".OVL");
  45.    else
  46.       strcpy (p, ".OVL");
  47.  
  48.    do {
  49.       i = spawnvp (P_WAIT, argv0, args);
  50.    } while (i == 255);
  51.  
  52.    exit (i);
  53. }
  54.  
  55.