From cc6c5bbd8a277969b30b85dfab8a0fb11066bc9e Mon Sep 17 00:00:00 2001 From: james <> Date: Thu, 28 Feb 2008 15:37:06 +0000 Subject: *** empty log message *** --- src/cmd.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/cmd.c') diff --git a/src/cmd.c b/src/cmd.c index 21a7909..a2cf7cd 100644 --- a/src/cmd.c +++ b/src/cmd.c @@ -10,6 +10,9 @@ static char rcsid[] = "$Id$"; /* * $Log$ + * Revision 1.5 2008/02/28 15:37:06 james + * *** empty log message *** + * * Revision 1.4 2008/02/28 11:27:48 james * *** empty log message *** * @@ -27,7 +30,7 @@ static char rcsid[] = "$Id$"; #include "project.h" -void +int cmd_parse (Cmd * c, Context * ctx, char *buf) { if (!strcmp (buf, "quit")) @@ -52,8 +55,10 @@ cmd_parse (Cmd * c, Context * ctx, char *buf) ctx->k->set_size (ctx->k, ctx,atoi(buf+5),0); else if (!strncmp (buf, "height", 6)) ctx->k->set_size (ctx->k, ctx,0,atoi(buf+6)); - else - c->error++; + else return -1; + +return 0; + } @@ -78,14 +83,18 @@ cmd_key (Cmd * c, Context * ctx, int key) if (c->error) { c->error=0; + c->active=0; cmd_show_status (c, ctx); return 0; } if (key == 13) { - cmd_parse (c, ctx, c->buf + 1); + if (cmd_parse (c, ctx, c->buf + 1)) { + c->error++; + } else{ c->active = 0; + } cmd_show_status (c, ctx); return 0; } -- cgit v1.2.3