summaryrefslogtreecommitdiff
path: root/source/cmd.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-09-25 13:13:05 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-09-25 13:13:05 +0000
commit95f993680be144ec40fa7f08002faf27a2e229a7 (patch)
treed1bf8e3174ffbe3e6bb332682b70c694b898da67 /source/cmd.c
parentea8394f51c74208866a891def93c55bd6cd3529e (diff)
Strip trailing whitespace as gi.args() expects.
Properly set maxChars value for input fields on Unix.
Diffstat (limited to 'source/cmd.c')
-rw-r--r--source/cmd.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/cmd.c b/source/cmd.c
index 528a3cf..0d57654 100644
--- a/source/cmd.c
+++ b/source/cmd.c
@@ -1036,6 +1036,15 @@ void Cmd_TokenizeString( const char *text, qboolean macroExpand ) {
return;
}
+// strip off any trailing whitespace
+ while( cmd_string_len ) {
+ if( cmd_string[ cmd_string_len - 1 ] > ' ' ) {
+ break;
+ }
+ cmd_string[ cmd_string_len - 1 ] = 0;
+ cmd_string_len--;
+ }
+
dest = cmd_data;
start = data = cmd_string;
while( cmd_argc < MAX_STRING_TOKENS ) {