diff options
author | james <> | 2008-02-28 15:37:06 +0000 |
---|---|---|
committer | james <> | 2008-02-28 15:37:06 +0000 |
commit | cc6c5bbd8a277969b30b85dfab8a0fb11066bc9e (patch) | |
tree | 1a15787db329145e96fd74947784a433074de068 /src/cmd.c | |
parent | 9a70b588086552c2f8a32b283061322426f62e84 (diff) | |
download | sympathy-cc6c5bbd8a277969b30b85dfab8a0fb11066bc9e.tar.gz sympathy-cc6c5bbd8a277969b30b85dfab8a0fb11066bc9e.tar.bz2 sympathy-cc6c5bbd8a277969b30b85dfab8a0fb11066bc9e.zip |
*** empty log message ***
Diffstat (limited to 'src/cmd.c')
-rw-r--r-- | src/cmd.c | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -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; } |