diff options
author | Andrey Nazarov <skuller@skuller.net> | 2007-09-30 13:06:34 +0000 |
---|---|---|
committer | Andrey Nazarov <skuller@skuller.net> | 2007-09-30 13:06:34 +0000 |
commit | 859e34f1f5c95c3b2c6a95b57496f11bb970a2f3 (patch) | |
tree | d52ab4513b0a4eadd788f23aaf30bf6872d0679b /source/q_shared.c | |
parent | 46fffc982f93b82a695861493b0b6c9ce668b23a (diff) |
Make sure Info_RemoveKey removes any possible duplicates.
Misc code cleanup.
Diffstat (limited to 'source/q_shared.c')
-rw-r--r-- | source/q_shared.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/q_shared.c b/source/q_shared.c index 3077913..48f7e1e 100644 --- a/source/q_shared.c +++ b/source/q_shared.c @@ -1964,7 +1964,6 @@ Info_RemoveKey void Info_RemoveKey( char *s, const char *key ) { char *start; char pkey[MAX_INFO_STRING]; - char value[MAX_INFO_STRING]; char *o; if( strchr( key, '\\' ) ) { @@ -1984,17 +1983,18 @@ void Info_RemoveKey( char *s, const char *key ) { *o = 0; s++; - o = value; while( *s != '\\' && *s ) { - if( !*s ) - return; - *o++ = *s++; + s++; } - *o = 0; if( !strcmp( key, pkey ) ) { - strcpy( start, s ); // remove this part - return; + o = start; // remove this part + while( *s ) { + *o++ = *s++; + } + *o = 0; + s = start; + continue; // search for duplicates } if( !*s ) |