diff --git a/src/external/Nonlocal/Makefile.am b/src/external/Nonlocal/Makefile.am index 0cdeadfe..65aa2c55 100644 --- a/src/external/Nonlocal/Makefile.am +++ b/src/external/Nonlocal/Makefile.am @@ -62,3 +62,13 @@ install-exec-hook: uninstall-hook: rm -f $(libdir)/libPNL_PippardFitter.so endif + +xmldir = $(HOME)/.musrfit/external +xml_DATA = nonlocal_startup.xml + +install-xml_DATA: $(xml_DATA) + $(INSTALL_DATA) '$(xml_DATA)' '$xmldir' + +uninstall-xml_DATA: $(xml_DATA) + $(RM) '$(xml_DATA)' '$xmldir' + diff --git a/src/external/Nonlocal/PNL_StartupHandler.cpp b/src/external/Nonlocal/PNL_StartupHandler.cpp index cd32a43a..a5b8aa08 100644 --- a/src/external/Nonlocal/PNL_StartupHandler.cpp +++ b/src/external/Nonlocal/PNL_StartupHandler.cpp @@ -56,7 +56,8 @@ PNL_StartupHandler::PNL_StartupHandler() fTrimSpDataPath = TString(""); // get default path (for the moment only linux like) - char startup_path_name[128]; + char startup_path_name[512]; + char *home_str; // check if the startup file is found in the current directory strcpy(startup_path_name, "./nonlocal_startup.xml"); @@ -65,7 +66,8 @@ PNL_StartupHandler::PNL_StartupHandler() fStartupFilePath = TString(startup_path_name); } else { // startup file is not found in the current directory cout << endl << "PNL_StartupHandler(): **WARNING** Couldn't find nonlocal_startup.xml in the current directory, will try default one." << endl; - strncpy(startup_path_name, "/home/nemu/analysis/musrfit/src/external/Nonlocal/nonlocal_startup.xml", sizeof(startup_path_name)); + home_str = getenv("$HOME"); + snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/nonlocal_startup.xml", home_str); if (StartupFileExists(startup_path_name)) { fStartupFileFound = true; fStartupFilePath = TString(startup_path_name);