]> git.tdb.fi Git - builder.git/commitdiff
Use parameterless system path accessors
authorMikko Rasa <tdb@tdb.fi>
Mon, 10 Nov 2014 17:49:30 +0000 (19:49 +0200)
committerMikko Rasa <tdb@tdb.fi>
Mon, 10 Nov 2014 17:49:30 +0000 (19:49 +0200)
Since the -C option causes a chdir early in the initialization, an argv[0]
of "./builder" could break things.

source/buildercli.cpp

index 7482aced39c9923a51083eb3d71b6cd2483956b4..2bea4ddad54d704404bacf73f18e1aa352d834ad 100644 (file)
@@ -15,6 +15,7 @@ using namespace std;
 using namespace Msp;
 
 BuilderCLI::BuilderCLI(int argc, char **argv):
+       RegisteredApplication<BuilderCLI>("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<FS::Path> 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<FS::Path>::const_iterator i=start_files.begin(); i!=start_files.end(); ++i)
                if(FS::exists(*i))
                        builder.load_build_file(*i);