From fd8f816ee13c797a6bbdd25952bfb4163ce48e56 Mon Sep 17 00:00:00 2001 From: curt <curt> Date: Mon, 6 Dec 2004 22:25:56 +0000 Subject: [PATCH] Fix a bug that could put the same airport object in the final .stg file twice, doesn't affect rendering, but could affect render performance. --- src/BuildTiles/Main/main.cxx | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/BuildTiles/Main/main.cxx b/src/BuildTiles/Main/main.cxx index 9052fe96..4682ae78 100644 --- a/src/BuildTiles/Main/main.cxx +++ b/src/BuildTiles/Main/main.cxx @@ -1004,25 +1004,29 @@ static void do_custom_objects( const TGConstruct& c ) { } else { while ( ! in.eof() ) { in.getline(line, 2048); + cout << "line = " << line << endl; - sscanf( line, "%s %s", token, name ); + int result = sscanf( line, "%s %s", token, name ); + cout << "scanf scanned " << result << " tokens" << endl; - cout << "token = " << token << " name = " << name << endl; + if ( result > 0 ) { + cout << "token = " << token << " name = " << name << endl; - if ( strcmp( token, "OBJECT" ) == 0 ) { + if ( strcmp( token, "OBJECT" ) == 0 ) { #ifdef _MSC_VER - string command = "copy " + base_dir + "/" + name + ".gz " - + dest_dir; + string command = "copy " + base_dir + "/" + name + ".gz " + + dest_dir; #else - string command = "cp " + base_dir + "/" + name + ".gz " - + dest_dir; + string command = "cp " + base_dir + "/" + name + ".gz " + + dest_dir; #endif - cout << "running " << command << endl; - system( command.c_str() ); + cout << "running " << command << endl; + system( command.c_str() ); - fprintf(fp, "OBJECT %s\n", name); - } else { - fprintf(fp, "%s\n", line); + fprintf(fp, "OBJECT %s\n", name); + } else { + fprintf(fp, "%s\n", line); + } } } }