[/trunk] Changeset 115 by mikael
* Remove trailing spaces in commands
* Fix a bug in last change related to completion (didn't compile)
--- 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;
}
--- a/mcabber/src/screen.c Thu Apr 21 17:21:49 2005 +0000
+++ b/mcabber/src/screen.c Thu Apr 21 17:31:28 2005 +0000
@@ -636,8 +636,8 @@
if (row == -1) return; // No completion if no leading slash
if (row == 0) { // Command completion
+ const char *cchar;
if (!completion_started) {
- const char *cchar;
GSList *list = compl_get_category_list(COMPL_CMD);
if (list) {
char *prefix = g_strndup(&inputLine[1], ptr_inputline-inputLine-1);