mcabber/src/commands.c
changeset 101 4f3ad00b5187
parent 98 f20831f7d349
child 102 2b4cc6bc5bf2
--- 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;
   }