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:
puggles 2004-09-15 12:09:21 +00:00
parent a82a0dff4a
commit 228c4bd617

View File

@ -597,16 +597,14 @@ void FGAPIENTRY glutInit( int* pargc, char** argv )
/*
* Compact {argv}.
*/
j = 2;
j = 1;
for( i = 1; i < *pargc; i++, j++ )
{
if( argv[ i ] == NULL )
{
/* Guaranteed to end because there are "*pargc" arguments left */
while ( argv[ j ] == NULL )
j++;
/* Guaranteed to end because there are "*pargc" arguments left */
while ( argv[ j ] == NULL )
j++;
if (i != j)
argv[ i ] = argv[ j ];
}
}
#endif /* TARGET_HOST_WINCE */