From 191f167c1b44679707028d96aae8a2d67fecce30 Mon Sep 17 00:00:00 2001 From: "J.C. Jones" Date: Wed, 15 Sep 2004 12:09:21 +0000 Subject: [PATCH] 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 --- src/freeglut_init.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) 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 */ -- 1.7.10.4