]> Kevux Git Server - fll/commitdiff
Bugfix: The fl_directory_create() is failing on directory exists with path ends in...
authorKevin Day <Kevin@kevux.org>
Fri, 9 May 2025 02:28:08 +0000 (21:28 -0500)
committerKevin Day <Kevin@kevux.org>
Fri, 9 May 2025 02:28:08 +0000 (21:28 -0500)
The final directory gets created in the loop before the final directory create is called.

Check if the directory exists before the final directory create call.

level_1/fl_directory/c/directory.c

index 23cb7b2798eac4dcb62c6bef0a771598169c3742..e94d991b55554184edde9ca3435ac36f45be692e 100644 (file)
@@ -48,7 +48,14 @@ extern "C" {
       } // for
     }
 
-    return f_directory_create(path, mode);
+    status = f_directory_exists(path);
+    if (F_status_is_error(status)) return status;
+
+    if (status == F_false || status == F_file_found_not) {
+      return f_directory_create(path, mode);
+    }
+
+    return F_none;
   }
 #endif // _di_fl_directory_create_