Subversion Repositories SvarDOS

Rev

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

Rev 538 Rev 543
Line 729... Line 729...
729
  static struct rmod_props far *rmod;
729
  static struct rmod_props far *rmod;
730
  static char cmdlinebuf[CMDLINE_MAXLEN + 2]; /* 1 extra byte for 0-terminator and another for memguard */
730
  static char cmdlinebuf[CMDLINE_MAXLEN + 2]; /* 1 extra byte for 0-terminator and another for memguard */
731
  static char *cmdline;
731
  static char *cmdline;
732
  static struct redir_data redirprops;
732
  static struct redir_data redirprops;
733
  static enum cmd_result cmdres;
733
  static enum cmd_result cmdres;
-
 
734
  static unsigned short i; /* general-purpose variable for short-lived things */
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 791... Line 792...
791
    cmdline = cmdlinebuf;
792
    cmdline = cmdlinebuf;
792
 
793
 
793
    /* (re)load translation strings if needed */
794
    /* (re)load translation strings if needed */
794
    nls_langreload(BUFFER, *rmod_envseg);
795
    nls_langreload(BUFFER, *rmod_envseg);
795
 
796
 
-
 
797
    /* load awaiting command, if any (used to run piped commands) */
-
 
798
    if (rmod->awaitingcmd[0] != 0) {
-
 
799
      _fstrcpy(cmdline, rmod->awaitingcmd);
-
 
800
      rmod->awaitingcmd[0] = 0;
-
 
801
      goto EXEC_CMDLINE;
-
 
802
    }
-
 
803
 
796
    /* skip user input if I have a command to exec (/C or /K) */
804
    /* skip user input if I have a command to exec (/C or /K) */
797
    if (cfg.execcmd != NULL) {
805
    if (cfg.execcmd != NULL) {
798
      cmdline = cfg.execcmd;
806
      cmdline = cfg.execcmd;
799
      cfg.execcmd = NULL;
807
      cfg.execcmd = NULL;
800
      goto EXEC_CMDLINE;
808
      goto EXEC_CMDLINE;
Line 842... Line 850...
842
 
850
 
843
    /* update rmod's ptr to COMPSPEC so it is always up to date */
851
    /* update rmod's ptr to COMPSPEC so it is always up to date */
844
    rmod_updatecomspecptr(rmod->rmodseg, *rmod_envseg);
852
    rmod_updatecomspecptr(rmod->rmodseg, *rmod_envseg);
845
 
853
 
846
    /* handle redirections (if any) */
854
    /* handle redirections (if any) */
847
    redir_parsecmd(&redirprops, cmdline);
855
    i = redir_parsecmd(&redirprops, cmdline, rmod->awaitingcmd);
-
 
856
    if (i != 0) {
-
 
857
      nls_outputnl_doserr(i);
-
 
858
      rmod->awaitingcmd[0] = 0;
-
 
859
      continue;
-
 
860
    }
848
 
861
 
849
    /* try matching (and executing) an internal command */
862
    /* try matching (and executing) an internal command */
850
    cmdres = cmd_process(rmod, *rmod_envseg, cmdline, BUFFER, sizeof(BUFFER), &redirprops);
863
    cmdres = cmd_process(rmod, *rmod_envseg, cmdline, BUFFER, sizeof(BUFFER), &redirprops);
851
    if ((cmdres == CMD_OK) || (cmdres == CMD_FAIL)) {
864
    if ((cmdres == CMD_OK) || (cmdres == CMD_FAIL)) {
852
      /* internal command executed */
865
      /* internal command executed */