Subversion Repositories SvarDOS

Rev

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

Rev 526 Rev 533
Line 729... Line 729...
729
  static unsigned short far *lastexitcode;
729
  static unsigned short far *lastexitcode;
730
  static struct rmod_props far *rmod;
730
  static struct rmod_props far *rmod;
731
  static char cmdlinebuf[CMDLINE_MAXLEN + 2]; /* 1 extra byte for 0-terminator and another for memguard */
731
  static char cmdlinebuf[CMDLINE_MAXLEN + 2]; /* 1 extra byte for 0-terminator and another for memguard */
732
  static char *cmdline;
732
  static char *cmdline;
733
  static struct redir_data redirprops;
733
  static struct redir_data redirprops;
-
 
734
  static enum cmd_result cmdres;
734
 
735
 
735
  rmod = rmod_find(BUFFER_len);
736
  rmod = rmod_find(BUFFER_len);
736
  if (rmod == NULL) {
737
  if (rmod == NULL) {
737
    /* look at command line parameters (in case env size if set there) */
738
    /* look at command line parameters (in case env size if set there) */
738
    parse_argv(&cfg);
739
    parse_argv(&cfg);
Line 845... Line 846...
845
 
846
 
846
    /* handle redirections (if any) */
847
    /* handle redirections (if any) */
847
    redir_parsecmd(&redirprops, cmdline);
848
    redir_parsecmd(&redirprops, cmdline);
848
 
849
 
849
    /* try matching (and executing) an internal command */
850
    /* try matching (and executing) an internal command */
850
    if (cmd_process(rmod, *rmod_envseg, cmdline, BUFFER, sizeof(BUFFER), &redirprops) >= -1) {
851
    cmdres = cmd_process(rmod, *rmod_envseg, cmdline, BUFFER, sizeof(BUFFER), &redirprops);
-
 
852
    if ((cmdres == CMD_OK) || (cmdres == CMD_FAIL)) {
851
      /* internal command executed */
853
      /* internal command executed */
852
      continue;
854
      continue;
-
 
855
    } else if (cmdres == CMD_CHANGED) { /* cmdline changed, needs to be reprocessed */
-
 
856
      goto EXEC_CMDLINE;
-
 
857
    } else if (cmdres == CMD_NOTFOUND) {
-
 
858
      /* this was not an internal command, try matching an external command */
-
 
859
      run_as_external(BUFFER, cmdline, *rmod_envseg, rmod, &redirprops);
-
 
860
      /* perhaps this is a newly launched BAT file */
-
 
861
      if ((rmod->batfile[0] != 0) && (rmod->batnextline == 0)) goto SKIP_NEWLINE;
-
 
862
      /* run_as_external() does not return on success, if I am still alive then
-
 
863
       * external command failed to execute */
-
 
864
      outputnl("Bad command or file name");
-
 
865
      continue;
853
    }
866
    }
854
 
867
 
855
    /* if here, then this was not an internal command */
-
 
856
    run_as_external(BUFFER, cmdline, *rmod_envseg, rmod, &redirprops);
-
 
857
    /* perhaps this is a newly launched BAT file */
868
    /* I should never ever land here */
858
    if ((rmod->batfile[0] != 0) && (rmod->batnextline == 0)) goto SKIP_NEWLINE;
-
 
859
 
-
 
860
    /* run_as_external() does not return on success, if I am still alive then
-
 
861
     * external command failed to execute */
-
 
862
    outputnl("Bad command or file name");
869
    outputnl("INTERNAL ERR: INVALID CMDRES");
863
 
870
 
864
  } while ((rmod->flags & FLAG_EXEC_AND_QUIT) == 0);
871
  } while ((rmod->flags & FLAG_EXEC_AND_QUIT) == 0);
865
 
872
 
866
  sayonara(rmod);
873
  sayonara(rmod);
867
  return(0);
874
  return(0);