aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd.c')
-rw-r--r--src/cmd.c17
1 files changed, 13 insertions, 4 deletions
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;
}