From: J.C. Jones Date: Wed, 15 Sep 2004 12:09:21 +0000 (+0000) Subject: Fix to glutInit() command-line argument compaction - Patch #1027724 from takeshi2 X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=191f167c1b44679707028d96aae8a2d67fecce30;p=freeglut Fix to glutInit() command-line argument compaction - Patch #1027724 from takeshi2 git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@516 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/src/freeglut_init.c b/src/freeglut_init.c index 311526e..7b49169 100644 --- a/src/freeglut_init.c +++ b/src/freeglut_init.c @@ -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 */