struct cmndstr *command; /* currently executing command */
struct iop *iop;
char combuf[1024]; /* command input buffer, UTF-8 */
+ char argbuf[1024]; /* argument buffer, ASCII */
char *argp[128]; /* arguments, ASCII, valid if command */
char *condarg; /* conditional, ASCII, valid if command */
char *comtail[128]; /* start of args in combuf[] */
int skip = 0;
char buf[1024];
char prompt[128];
- char scanspace[1024];
char pathtaken[1024]; /* Doubtful we'll have a path longer than this */
char *pt = pathtaken;
char bmap_flag;
cp++;
continue;
}
- ac = parse(cp, scanspace, player->argp, NULL, NULL, NULL);
+ ac = parse(cp, player->argbuf, player->argp, NULL, NULL, NULL);
if (ac <= 0) {
player->argp[0] = "";
cp = NULL;
{
struct natstr *natp = getnatp(player->cnum);
char *redir; /* UTF-8 */
- char scanspace[1024];
time_t now;
prprompt(natp->nat_timeused / 60, natp->nat_btu);
if (!player->god && !may_play_now(natp, now))
return 0;
- if (parse(player->combuf, scanspace, player->argp, player->comtail,
- &player->condarg, &redir) < 0) {
+ if (parse(player->combuf, player->argbuf, player->argp,
+ player->comtail, &player->condarg, &redir) < 0) {
pr("See \"info Syntax\"?\n");
} else {
if (dispatch(player->combuf, redir) < 0)
return 1;
}
-/* Is ARG one of the player's last command's arguments? */
-static int
-is_command_arg(char *arg)
-{
- int i;
-
- for (i = 1; i < 128 && player->argp[i]; i++) {
- if (arg == player->argp[i])
- return 1;
- }
- return 0;
-}
-
/*
* Make all objects stale if ARG is one of the player's command arguments.
* See ef_make_stale() for what "making stale" means.
void
make_stale_if_command_arg(char *arg)
{
- if (is_command_arg(arg))
+ if (player->argbuf <= arg
+ && arg <= player->argbuf + sizeof(player->argbuf))
ef_make_stale();
}
int failed;
char *p; /* UTF-8 */
char *redir; /* UTF-8 */
- char scanspace[1024];
failed = 0;
while (!failed && status()) {
player->nstat &= ~EXEC;
- if (getcommand(buf) < 0)
+ if (getcommand(player->combuf) < 0)
break;
- if (parse(buf, scanspace, player->argp, player->comtail,
- &player->condarg, &redir) < 0) {
+ if (parse(player->combuf, player->argbuf, player->argp,
+ player->comtail, &player->condarg, &redir) < 0) {
failed = 1;
continue;
}