amxmodx/compiler/libpc300/scstub.c

30 lines
578 B
C
Raw Normal View History

2005-07-25 00:00:55 +04:00
#include <process.h>
#include <stdio.h>
#include <string.h>
static char filename[] = "pccdos.exe";
int main(int argc, char *argv[])
{
int result;
/* build a command line to pass on to the "DOS" program */
char path[80], *ptr;
strcpy(path,argv[0]);
ptr=strrchr(path,'\\');
if (ptr==NULL)
ptr=strchr(path,':');
if (ptr==NULL) {
strcpy(path,filename);
} else {
strcpy(ptr+1,filename);
} /* if */
/* launch the DOS version of the tool */
result=execv(path,argv);
if (result==-1)
printf("Error launching '%s'\n",path);
return result;
}