1
0
Fork 0

command /c works with batch files as well :)

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@889
This commit is contained in:
Peter Veenstra 2003-04-08 18:24:38 +00:00
parent e5d49d2072
commit 24e82f2d33
2 changed files with 25 additions and 2 deletions

View file

@ -93,13 +93,35 @@ void DOS_Shell::ParseLine(char * line) {
void DOS_Shell::RunInternal(void)
{
char input_line[CMD_MAXLINE];
std::string line;
while(bf && bf->ReadLine(input_line))
{
if (echo) {
if (input_line[0]!='@') {
ShowPrompt();
WriteOut(input_line);
WriteOut("\n");
};
};
ParseLine(input_line);
}
return;
}
void DOS_Shell::Run(void) {
char input_line[CMD_MAXLINE];
std::string line;
if (cmd->FindStringRemain("/C",line)) {
strcpy(input_line,line.c_str());
ParseLine(input_line);
DOS_Shell temp;
temp.echo = echo;
temp.ParseLine(input_line); //for *.exe *.com |*.bat creates the bf needed by runinternal;
temp.RunInternal(); // exits when no bf is found.
return;
}
/* Start a normal shell and check for a first command init */

View file

@ -52,6 +52,7 @@ class DOS_Shell : public Program {
public:
DOS_Shell();
void Run(void);
void RunInternal(void); //for command /C
/* A load of subfunctions */
void ParseLine(char * line);
Bit32u GetRedirection(char *s, char **ifn, char **ofn);
@ -90,7 +91,7 @@ public:
Bitu index;
Bitu size;
} old;
};
struct SHELL_Cmd {