Browse Source

HPCC-21507 renamePhysicalPartFiles override base path fix

Ensure provided base path is used correctly.

Signed-off-by: Jake Smith <jake.smith@lexisnexisrisk.com>
Jake Smith 6 years ago
parent
commit
e1ace0125b
1 changed files with 7 additions and 1 deletions
  1. 7 1
      dali/base/dadfs.cpp

+ 7 - 1
dali/base/dadfs.cpp

@@ -4135,10 +4135,16 @@ public:
         char psc = getPathSepChar(directory.get());
         char psc = getPathSepChar(directory.get());
         DFD_OS os = SepCharBaseOs(psc);
         DFD_OS os = SepCharBaseOs(psc);
         StringBuffer basedir;
         StringBuffer basedir;
+
+        const char *myBase;
         if (newbasedir)
         if (newbasedir)
+        {
             diroverride = newbasedir;
             diroverride = newbasedir;
+            myBase = newbasedir;
+        }
+        else
+            myBase = queryBaseDirectory(grp_unknown, 0, os);
 
 
-        const char *myBase = queryBaseDirectory(grp_unknown, 0, os);
         StringBuffer baseDir, newPath;
         StringBuffer baseDir, newPath;
         makePhysicalPartName(logicalName.get(), 0, 0, newPath, false, os, diroverride);
         makePhysicalPartName(logicalName.get(), 0, 0, newPath, false, os, diroverride);
         if (!getBase(directory, newPath, baseDir))
         if (!getBase(directory, newPath, baseDir))