From 46c0a8c31935dc892123c99ef0a6a7872dbfd828 Mon Sep 17 00:00:00 2001 From: Ovidiu Mircescu Date: Thu, 13 Nov 2014 15:34:19 +0100 Subject: [PATCH] Fix SalomeLauncher::getJobResults when the directory is specified. There was a case where SalomeLauncher::getJobResults would have copied the remote files to another directory than the one chosen in the parameters of the function. --- src/Launcher/Launcher_Job.cxx | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Launcher/Launcher_Job.cxx b/src/Launcher/Launcher_Job.cxx index 957c42c5a..83e007c0c 100644 --- a/src/Launcher/Launcher_Job.cxx +++ b/src/Launcher/Launcher_Job.cxx @@ -629,17 +629,20 @@ Launcher::Job::common_job_params() for(std::list::iterator it = _out_files.begin(); it != _out_files.end(); it++) { std::string file = *it; - - // local file - size_t found = file.find_last_of("/"); - std::string local_file = _result_directory + "/" + file.substr(found+1); - // remote file -> If file is not an absolute path, we apply _work_directory std::string remote_file; + std::string local_file; if (file.substr(0, 1) == std::string("/")) + { remote_file = file; + size_t found = file.find_last_of("/"); + local_file = file.substr(found+1); + } else + { remote_file = _work_directory + "/" + file; + local_file = file; + } params[Batch::OUTFILE] += Batch::Couple(local_file, remote_file); } -- 2.39.2