aboutsummaryrefslogtreecommitdiffstats
path: root/src/cmd.c
diff options
context:
space:
mode:
authorjames <>2008-02-28 16:58:49 +0000
committerjames <>2008-02-28 16:58:49 +0000
commit68f1170ace397c32f9c80a6b7cb89388d88743f2 (patch)
tree3dbafbe88e81f2ba7c8c877c91a1f31d04941864 /src/cmd.c
parent57dd88f415d70356e41f2bfd5c00c250bd085723 (diff)
downloadsympathy-68f1170ace397c32f9c80a6b7cb89388d88743f2.tar.gz
sympathy-68f1170ace397c32f9c80a6b7cb89388d88743f2.tar.bz2
sympathy-68f1170ace397c32f9c80a6b7cb89388d88743f2.zip
*** empty log message ***
Diffstat (limited to 'src/cmd.c')
-rw-r--r--src/cmd.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/cmd.c b/src/cmd.c
index a2cf7cd..7e86977 100644
--- a/src/cmd.c
+++ b/src/cmd.c
@@ -10,6 +10,9 @@ static char rcsid[] = "$Id$";
/*
* $Log$
+ * Revision 1.6 2008/02/28 16:57:51 james
+ * *** empty log message ***
+ *
* Revision 1.5 2008/02/28 15:37:06 james
* *** empty log message ***
*
@@ -52,12 +55,13 @@ cmd_parse (Cmd * c, Context * ctx, char *buf)
else if (!strcmp (buf, "reset"))
ctx->k->reset (ctx->k, ctx);
else if (!strncmp (buf, "width", 5))
- ctx->k->set_size (ctx->k, ctx,atoi(buf+5),0);
+ 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 return -1;
+ ctx->k->set_size (ctx->k, ctx, 0, atoi (buf + 6));
+ else
+ return -1;
-return 0;
+ return 0;
}
@@ -68,7 +72,7 @@ cmd_show_status (Cmd * c, Context * ctx)
if (!ctx->v)
return;
- if (c->error)
+ if (c->error)
vt102_status_line (ctx->v, "Command not recognized - press any key");
else if (!c->active)
vt102_status_line (ctx->v, c->csl);
@@ -81,20 +85,24 @@ int
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 (c->error)
+ {
+ c->error = 0;
+ c->active = 0;
+ cmd_show_status (c, ctx);
+ return 0;
+ }
if (key == 13)
{
- if (cmd_parse (c, ctx, c->buf + 1)) {
- c->error++;
- } else{
- c->active = 0;
- }
+ if (cmd_parse (c, ctx, c->buf + 1))
+ {
+ c->error++;
+ }
+ else
+ {
+ c->active = 0;
+ }
cmd_show_status (c, ctx);
return 0;
}