Parcourir la source

BUG: Do not create a directory on top of a file.

Brad King il y a 21 ans
Parent
commit
a2949c204d
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      Source/kwsys/SystemTools.cxx

+ 7 - 1
Source/kwsys/SystemTools.cxx

@@ -235,10 +235,16 @@ const char* SystemTools::GetExecutableExtension()
 
 bool SystemTools::MakeDirectory(const char* path)
 {
-  if(SystemTools::FileExists(path))
+  if(SystemTools::FileIsDirectory(path))
     {
     return true;
     }
+
+  // Do not make a directory on top of a file.
+  if(SystemTools::FileExists(path))
+    {
+    return false;
+    }
   kwsys_stl::string dir = path;
   if(dir.size() == 0)
     {