Mercurial > hg
diff mcabber/src/commands.c @ 101:4f3ad00b5187
[/trunk] Changeset 115 by mikael
* Remove trailing spaces in commands
* Fix a bug in last change related to completion (didn't compile)
author | mikael |
---|---|
date | Thu, 21 Apr 2005 17:31:28 +0000 |
parents | f20831f7d349 |
children | 2b4cc6bc5bf2 |
line wrap: on
line diff
--- a/mcabber/src/commands.c Thu Apr 21 17:21:49 2005 +0000 +++ b/mcabber/src/commands.c Thu Apr 21 17:31:28 2005 +0000 @@ -120,10 +120,20 @@ // currently selected buddy. int process_line(char *line) { + char *p; if (*line != '/') { send_message(line); // FIXME: are we talking to a _buddy_? return 0; } + + /* It is a command */ + // Remove trailing spaces: + for (p=line ; *p ; p++) + ; + for (p-- ; p>line && (*p == ' ') ; p--) + *p = 0; + + // Command "quit"? if (!strcasecmp(line, "/quit")) { return 255; }