From: Mikko Rasa Date: Mon, 10 Nov 2014 17:49:30 +0000 (+0200) Subject: Use parameterless system path accessors X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=8c9e5422b0ef5ee6d80cc23db8fe84f4a0812ddc;p=builder.git Use parameterless system path accessors Since the -C option causes a chdir early in the initialization, an argv[0] of "./builder" could break things. --- diff --git a/source/buildercli.cpp b/source/buildercli.cpp index 7482ace..2bea4dd 100644 --- a/source/buildercli.cpp +++ b/source/buildercli.cpp @@ -15,6 +15,7 @@ using namespace std; using namespace Msp; BuilderCLI::BuilderCLI(int argc, char **argv): + RegisteredApplication("builder"), analyzer(0), build(false), clean(0), @@ -144,15 +145,15 @@ BuilderCLI::BuilderCLI(int argc, char **argv): package_manager.append_package_path(cwd); package_manager.append_package_path(cwd/".."); - package_manager.append_binary_package_path(FS::get_sys_data_dir(argv[0], "builder")/"packages"); + package_manager.append_binary_package_path(FS::get_sys_data_dir()/"packages"); package_manager.set_no_externals(no_externals); builder.set_architecture(arch); list start_files; - start_files.push_back(FS::get_sys_data_dir(argv[0], "builder")/"builderrc"); - start_files.push_back(FS::get_user_data_dir("builder")/"rc"); + start_files.push_back(FS::get_sys_data_dir()/"builderrc"); + start_files.push_back(FS::get_user_data_dir()/"rc"); for(list::const_iterator i=start_files.begin(); i!=start_files.end(); ++i) if(FS::exists(*i)) builder.load_build_file(*i);