Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
100:8fedef290c4e | 101:4f3ad00b5187 |
---|---|
118 // Process a command/message line. | 118 // Process a command/message line. |
119 // If this isn't a command, this is a message and it is sent to the | 119 // If this isn't a command, this is a message and it is sent to the |
120 // currently selected buddy. | 120 // currently selected buddy. |
121 int process_line(char *line) | 121 int process_line(char *line) |
122 { | 122 { |
123 char *p; | |
123 if (*line != '/') { | 124 if (*line != '/') { |
124 send_message(line); // FIXME: are we talking to a _buddy_? | 125 send_message(line); // FIXME: are we talking to a _buddy_? |
125 return 0; | 126 return 0; |
126 } | 127 } |
128 | |
129 /* It is a command */ | |
130 // Remove trailing spaces: | |
131 for (p=line ; *p ; p++) | |
132 ; | |
133 for (p-- ; p>line && (*p == ' ') ; p--) | |
134 *p = 0; | |
135 | |
136 // Command "quit"? | |
127 if (!strcasecmp(line, "/quit")) { | 137 if (!strcasecmp(line, "/quit")) { |
128 return 255; | 138 return 255; |
129 } | 139 } |
130 // Commands handling | 140 // Commands handling |
131 // TODO | 141 // TODO |