Subversion Repositories SvarDOS

Compare Revisions

Ignore whitespace Rev 471 → Rev 472

/svarcom/trunk/command.c
347,12 → 347,12
 
 
static void run_as_external(char *buff, const char far *cmdline, unsigned short envseg, struct rmod_props far *rmod) {
char const **argvlist = (void *)(buff + 512);
char *cmdfile = buff + 1024;
char *cmdfile = buff + 512;
const char far *pathptr;
int lookup;
unsigned short i;
const char *ext;
char *cmd = buff + 256;
const char far *cmdtail;
char far *rmod_execprog = MK_FP(rmod->rmodseg, RMOD_OFFSET_EXECPROG);
char far *rmod_cmdtail = MK_FP(rmod->rmodseg, 0x81);
363,12 → 363,18
unsigned long fcb2;
} far *ExecParam = MK_FP(rmod->rmodseg, RMOD_OFFSET_EXECPARAM);
 
cmd_explode(buff + 2048, cmdline, argvlist);
/* find cmd and cmdtail */
i = 0;
cmdtail = cmdline;
while (*cmdtail == ' ') cmdtail++; /* skip any leading spaces */
while ((*cmdtail != ' ') && (*cmdtail != '/') && (*cmdtail != '+') && (*cmdtail != 0)) {
cmd[i++] = *cmdtail;
cmdtail++;
}
cmd[i] = 0;
 
/* for (i = 0; argvlist[i] != NULL; i++) printf("arg #%d = '%s'\r\n", i, argvlist[i]); */
 
/* is this a command in curdir? */
lookup = lookup_cmd(cmdfile, argvlist[0], NULL, &ext);
lookup = lookup_cmd(cmdfile, cmd, NULL, &ext);
if (lookup == 0) {
/* printf("FOUND LOCAL EXEC FILE: '%s'\r\n", cmdfile); */
goto RUNCMDFILE;
389,7 → 395,7
pathptr++;
}
buff[i] = 0;
lookup = lookup_cmd(cmdfile, argvlist[0], buff, &ext);
lookup = lookup_cmd(cmdfile, cmd, buff, &ext);
if (lookup == 0) break;
if (lookup == -2) return;
if (*pathptr == ';') {
401,13 → 407,6
 
RUNCMDFILE:
 
/* find cmdtail */
cmdtail = cmdline;
while (*cmdtail == ' ') cmdtail++;
while ((*cmdtail != ' ') && (*cmdtail != '/') && (*cmdtail != '+') && (*cmdtail != 0)) {
cmdtail++;
}
 
/* special handling of batch files */
if ((ext != NULL) && (imatch(ext, "bat"))) {
/* copy truename of the bat file to rmod buff */