diff --git a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx index 80125c1c807f84fb21ff8f08d68eee066e3f3b43..38db567cdb9e6b099fc0feba143a90913a267ccf 100644 --- a/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx +++ b/Code/Wrappers/CommandLine/otbWrapperCommandLineLauncher.cxx @@ -237,7 +237,10 @@ CommandLineLauncher::LoadPath() for( unsigned i=0; i<pathList.size(); i++) { m_Path.append(pathList[i]); - m_Path.append(":"); + if( i < pathList.size()-1 ) + { + m_Path.append(":"); + } } std::string specificEnv("ITK_AUTOLOAD_PATH="); @@ -270,12 +273,19 @@ CommandLineLauncher::LoadApplication() std::cerr << "ERROR: Module search path: "<< itksys::SystemTools::GetEnv("ITK_AUTOLOAD_PATH") << std::endl; std::vector<std::string> list = ApplicationRegistry::GetAvailableApplications(); - std::cerr << "ERROR: Available modules : " << (list.empty() ? "None" : "") << std::endl; - for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it) + if( list.size() == 0 ) { - std::cout << "\t" << *it << std::endl; + std::cerr << "ERROR: Available modules : none." << std::endl; + } + else + { + std::cerr << "ERROR: Available modules :" << std::endl; + for (std::vector<std::string>::const_iterator it = list.begin(); it != list.end(); ++it) + { + std::cout << "\t" << *it << std::endl; + } + return; } - return; } // Attach log output to the Application logger