Subversion Repositories SvarDOS

Rev

Rev 507 | Rev 517 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 507 Rev 508
Line 354... Line 354...
354
  char *cmdfile = buff + 512;
354
  char *cmdfile = buff + 512;
355
  const char far *pathptr;
355
  const char far *pathptr;
356
  int lookup;
356
  int lookup;
357
  unsigned short i;
357
  unsigned short i;
358
  const char *ext;
358
  const char *ext;
359
  char *cmd = buff + 256;
359
  char *cmd = buff + 1024;
360
  const char *cmdtail;
360
  const char *cmdtail;
361
  char far *rmod_execprog = MK_FP(rmod->rmodseg, RMOD_OFFSET_EXECPROG);
361
  char far *rmod_execprog = MK_FP(rmod->rmodseg, RMOD_OFFSET_EXECPROG);
362
  char far *rmod_cmdtail = MK_FP(rmod->rmodseg, 0x81);
362
  char far *rmod_cmdtail = MK_FP(rmod->rmodseg, 0x81);
363
  _Packed struct {
363
  _Packed struct {
364
    unsigned short envseg;
364
    unsigned short envseg;
Line 414... Line 414...
414
  /* special handling of batch files */
414
  /* special handling of batch files */
415
  if ((ext != NULL) && (imatch(ext, "bat"))) {
415
  if ((ext != NULL) && (imatch(ext, "bat"))) {
416
    /* copy truename of the bat file to rmod buff */
416
    /* copy truename of the bat file to rmod buff */
417
    for (i = 0; cmdfile[i] != 0; i++) rmod->batfile[i] = cmdfile[i];
417
    for (i = 0; cmdfile[i] != 0; i++) rmod->batfile[i] = cmdfile[i];
418
    rmod->batfile[i] = 0;
418
    rmod->batfile[i] = 0;
-
 
419
 
419
    /* copy args of the bat file to rmod buff */
420
    /* explode args of the bat file and store them in rmod buff */
-
 
421
    cmd_explode(buff, cmdline, NULL);
420
    for (i = 0; cmdtail[i] != 0; i++) rmod->batargs[i] = cmdtail[i];
422
    _fmemcpy(rmod->batargv, buff, sizeof(rmod->batargv));
-
 
423
 
421
    /* reset the 'next line to execute' counter */
424
    /* reset the 'next line to execute' counter */
422
    rmod->batnextline = 0;
425
    rmod->batnextline = 0;
423
    /* remember the echo flag (in case bat file disables echo) */
426
    /* remember the echo flag (in case bat file disables echo) */
424
    rmod->flags &= ~FLAG_ECHO_BEFORE_BAT;
427
    rmod->flags &= ~FLAG_ECHO_BEFORE_BAT;
425
    if (rmod->flags & FLAG_ECHOFLAG) rmod->flags |= FLAG_ECHO_BEFORE_BAT;
428
    if (rmod->flags & FLAG_ECHOFLAG) rmod->flags |= FLAG_ECHO_BEFORE_BAT;
Line 659... Line 662...
659
      continue;
662
      continue;
660
    }
663
    }
661
 
664
 
662
    /* digit? (bat arg) */
665
    /* digit? (bat arg) */
663
    if ((line[1] >= '0') && (line[1] <= '9')) {
666
    if ((line[1] >= '0') && (line[1] <= '9')) {
-
 
667
      unsigned short argid = line[1] - '0';
-
 
668
      unsigned short i;
-
 
669
      const char far *argv = rmod->batargv;
-
 
670
 
-
 
671
      /* locate the proper arg */
-
 
672
      for (i = 0; i != argid; i++) {
-
 
673
        /* if string is 0, then end of list reached */
-
 
674
        if (*argv == 0) break;
-
 
675
        /* jump to next arg */
-
 
676
        while (*argv != 0) argv++;
664
      /* TODO */
677
        argv++;
-
 
678
      }
-
 
679
 
-
 
680
      /* copy the arg to result */
-
 
681
      for (i = 0; (argv[i] != 0) && (reslen < ressz); i++) {
-
 
682
        res[reslen++] = argv[i];
-
 
683
      }
665
      line++;  /* skip the digit */
684
      line++;  /* skip the digit */
666
      continue;
685
      continue;
667
    }
686
    }
668
 
687
 
669
    /* opening perc */
688
    /* opening perc */