Subversion Repositories SvarDOS

Rev

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

Rev 364 Rev 366
Line 52... Line 52...
52
#include <string.h>
52
#include <string.h>
53
 
53
 
54
#include <process.h>
54
#include <process.h>
55
 
55
 
56
#include "cmd.h"
56
#include "cmd.h"
-
 
57
#include "env.h"
57
#include "helpers.h"
58
#include "helpers.h"
58
#include "rmodinit.h"
59
#include "rmodinit.h"
59
 
60
 
60
struct config {
61
struct config {
61
  int locate;
62
  int locate;
Line 312... Line 313...
312
 
313
 
313
    /* try matching (and executing) an internal command */
314
    /* try matching (and executing) an internal command */
314
    {
315
    {
315
      int ecode = cmd_process(*rmod_envseg, cmdline);
316
      int ecode = cmd_process(*rmod_envseg, cmdline);
316
      if (ecode >= 0) *lastexitcode = ecode;
317
      if (ecode >= 0) *lastexitcode = ecode;
-
 
318
      /* update rmod's ptr to COMPSPEC, in case it changed */
-
 
319
      {
-
 
320
        unsigned short far *comspecptr = MK_FP(rmod_seg, RMOD_OFFSET_COMSPECPTR);
-
 
321
        char far *comspecfp = env_lookup(*rmod_envseg, "COMSPEC");
-
 
322
        if (comspecfp != NULL) {
-
 
323
          *comspecptr = FP_OFF(comspecfp) + 8; /* +8 to skip the "COMSPEC=" prefix */
-
 
324
        } else {
-
 
325
          *comspecptr = 0;
-
 
326
        }
-
 
327
      }
317
      if (ecode >= -1) continue; /* internal command executed */
328
      if (ecode >= -1) continue; /* internal command executed */
318
    }
329
    }
319
 
330
 
320
    /* if here, then this was not an internal command */
331
    /* if here, then this was not an internal command */
321
    run_as_external(cmdline);
332
    run_as_external(cmdline);