Fix to glutInit() command-line argument compaction - Patch #1027724 from takeshi2
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@516 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
a82a0dff4a
commit
228c4bd617
@ -597,16 +597,14 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
|
|||||||
/*
|
/*
|
||||||
* Compact {argv}.
|
* Compact {argv}.
|
||||||
*/
|
*/
|
||||||
j = 2;
|
j = 1;
|
||||||
for( i = 1; i < *pargc; i++, j++ )
|
for( i = 1; i < *pargc; i++, j++ )
|
||||||
{
|
{
|
||||||
if( argv[ i ] == NULL )
|
/* Guaranteed to end because there are "*pargc" arguments left */
|
||||||
{
|
while ( argv[ j ] == NULL )
|
||||||
/* Guaranteed to end because there are "*pargc" arguments left */
|
j++;
|
||||||
while ( argv[ j ] == NULL )
|
if (i != j)
|
||||||
j++;
|
|
||||||
argv[ i ] = argv[ j ];
|
argv[ i ] = argv[ j ];
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* TARGET_HOST_WINCE */
|
#endif /* TARGET_HOST_WINCE */
|
||||||
|
Reference in New Issue
Block a user