From 95eb27de9a1ad7a9565c5ed10b0c7331ad668c2a Mon Sep 17 00:00:00 2001
From: Mathieu Doucet <doucetm@ornl.gov>
Date: Tue, 30 Aug 2011 19:19:58 +0000
Subject: [PATCH] Expand environment variables. Re #3332

---
 Code/Mantid/Framework/Kernel/src/ConfigService.cpp | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
index 0b2c3c5209b..281a8df8d92 100644
--- a/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
+++ b/Code/Mantid/Framework/Kernel/src/ConfigService.cpp
@@ -919,16 +919,18 @@ bool ConfigServiceImpl::hasProperty(const std::string& rootName) const
   return m_pConf->hasProperty(rootName) && m_pConf->getString(rootName) != m_removedFlag;
 }
 
-/** Checks to see whether the given file target is an executable one and it exists
+/** Checks to see whether the given file target is an executable one and it exists.
+ * This method will expand environment variables found in the given file path.
  *
- *  @param keyName :: The path to the file you wish to see whether it's an executable.
+ *  @param target :: The path to the file you wish to see whether it's an executable.
  *  @returns Boolean value denoting whether the file is an executable or not.
  */
 bool ConfigServiceImpl::isExecutable(const std::string& target) const
 {    
   try
   {
-    Poco::File tempFile = Poco::File(target);
+    std::string expTarget = Poco::Path::expand(target);
+    Poco::File tempFile = Poco::File(expTarget);
 
     if (tempFile.exists())
     {
-- 
GitLab