Skip to content

Commit 03d46d8

Browse files
committed
Syntax error if no command to pass output
1 parent 4dd3302 commit 03d46d8

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/shell/shell.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,15 @@ void DOS_Shell::ParseLine(char * line) {
449449
bool normalstdout = false; /* Bug: Assumed is they are "con" */
450450

451451
GetRedirection(line, &in, &out, &toc, &append);
452+
453+
if(toc && *trim(toc) == '\0') {
454+
SyntaxError(); /* No command to pass output */
455+
if(in) free(in);
456+
if(out) free(out);
457+
if(toc) free(toc);
458+
return;
459+
}
460+
452461
if (in || out || toc) {
453462
normalstdin = (psp->GetFileHandle(0) != 0xff);
454463
normalstdout = (psp->GetFileHandle(1) != 0xff);

0 commit comments

Comments
 (0)