From 8a9750155e4be08c278e4bc7ff601e091c6225b4 Mon Sep 17 00:00:00 2001 From: l_musr_tst Date: Wed, 10 Jun 2009 13:10:37 +0000 Subject: [PATCH] more flexible handling of paths --- src/classes/PStartupHandler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index 813a0129..f116c649 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -54,6 +54,7 @@ PStartupHandler::PStartupHandler() // get default path (for the moment only linux like) char *pmusrpath; + char *home; char musrpath[128]; char startup_path_name[128]; @@ -66,7 +67,8 @@ PStartupHandler::PStartupHandler() // check if the MUSRFITPATH system variable is set pmusrpath = getenv("MUSRFITPATH"); if (pmusrpath == 0) { // not set, will try default one - strcpy(musrpath, "/home/nemu/analysis/bin"); + home = getenv("HOME"); + sprintf(musrpath, "%s/analysis/bin", home); cout << endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << endl; } else { strncpy(musrpath, pmusrpath, sizeof(musrpath));