mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-23 12:32:09 +00:00
Quote commandline args with spaces when building the string for Com_Init().
This commit is contained in:
parent
ed241a8b73
commit
62ea802cea
1 changed files with 8 additions and 0 deletions
|
@ -542,7 +542,15 @@ int main( int argc, char **argv )
|
||||||
// Concatenate the command line for passing to Com_Init
|
// Concatenate the command line for passing to Com_Init
|
||||||
for( i = 1; i < argc; i++ )
|
for( i = 1; i < argc; i++ )
|
||||||
{
|
{
|
||||||
|
const qboolean containsSpaces = strchr(argv[i], ' ') != NULL;
|
||||||
|
if (containsSpaces)
|
||||||
|
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
|
||||||
|
|
||||||
Q_strcat( commandLine, sizeof( commandLine ), argv[ i ] );
|
Q_strcat( commandLine, sizeof( commandLine ), argv[ i ] );
|
||||||
|
|
||||||
|
if (containsSpaces)
|
||||||
|
Q_strcat( commandLine, sizeof( commandLine ), "\"" );
|
||||||
|
|
||||||
Q_strcat( commandLine, sizeof( commandLine ), " " );
|
Q_strcat( commandLine, sizeof( commandLine ), " " );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue