From: Markus Armbruster Date: Sun, 9 Dec 2007 17:06:03 +0000 (+0000) Subject: (execute): Clients can't reliably detect where a redirection ends X-Git-Tag: v4.3.11~44 X-Git-Url: http://git.pond.sub.org/?p=empserver;a=commitdiff_plain;h=ed8e0cd55272bb5c400a8efa1e8eec062ad3892d (execute): Clients can't reliably detect where a redirection ends because the server doesn't send C_PROMPT. The client simply rejects such redirections since servcmd.c rev. 1.42. Before it didn't, but incorrectly extended the redirection until the end of the script, and screwed up when there was more than one redirection in the execute. Make the server reject such redirections as well, because that's probably more useful and certainly less painful than documenting this mess. --- diff --git a/src/lib/player/player.c b/src/lib/player/player.c index 70ea2fe7b..9814ceb84 100644 --- a/src/lib/player/player.c +++ b/src/lib/player/player.c @@ -237,7 +237,6 @@ status(void) } /* - * actually a command; redirection and piping ignored. * XXX This whole mess should be redone; execute block should * start with "exec start", and should end with "exec end". * We'll wait until 1.2 I guess. @@ -252,7 +251,6 @@ execute(void) char scanspace[1024]; failed = 0; - redir = NULL; if (player->comtail[1]) p = player->comtail[1]; @@ -270,16 +268,17 @@ execute(void) failed = 1; continue; } - if (redir == NULL) - pr("\nExecute : %s\n", buf); - if (dispatch(buf, redir) < 0) + pr("\nExecute : %s\n", buf); + if (redir) { + pr("Execute : redirection not supported\n"); + failed = 1; + } else if (dispatch(buf, NULL) < 0) failed = 1; } if (failed) { while (recvclient(buf, sizeof(buf)) >= 0) ; } - if (redir == NULL) - pr("Execute : %s\n", failed ? "aborted" : "terminated"); + pr("Execute : %s\n", failed ? "aborted" : "terminated"); player->eof = 0; return RET_OK; }