*/
#include <config.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <errno.h>
-#include <fcntl.h>
+#include <errno.h>
+#include <stdio.h>
#include "com.h"
#include "empio.h"
#include "empthread.h"
#include "optlist.h"
#include "player.h"
#include "proto.h"
-#include "proto.h"
#include "prototypes.h"
#include "sect.h"
#include "tel.h"
if (getcommand(player->combuf) < 0)
return 0;
- if (parse(player->combuf, player->argp, &player->condarg,
- scanspace, &redir) < 0) {
+ if (parse(player->combuf, scanspace, player->argp, player->comtail,
+ &player->condarg, &redir) < 0) {
pr("See \"info Syntax\"?\n");
} else {
if (dispatch(player->combuf, redir) < 0)
failed = 0;
redir = NULL;
- p = getstarg(player->argp[1], "File? ", buf);
-
+ if (player->comtail[1])
+ p = player->comtail[1];
+ else
+ p = getstring("File? ", buf);
if (p == NULL || *p == '\0')
return RET_SYN;
-
- /* FIXME should use raw argument here, to support UTF-8 file names */
- prexec(player->argp[1]);
+ prexec(p);
while (!failed && status()) {
if (recvclient(buf, sizeof(buf)) < 0)
break;
- if (parse(buf, player->argp, &player->condarg,
- scanspace, &redir) < 0) {
+ if (parse(buf, scanspace, player->argp, player->comtail,
+ &player->condarg, &redir) < 0) {
failed = 1;
continue;
}
}
if (redir == NULL)
pr("Execute : %s\n", failed ? "aborted" : "terminated");
+ player->eof = 0;
return RET_OK;
}