]> 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:23:39 +0000 (21:23 -0500)
committerKevin Day <Kevin@kevux.org>
Fri, 9 May 2025 02:23:39 +0000 (21:23 -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 bb0ac9a84116357e0f1e6c3343798c7412108bc6..faab68e1db93c76a08ff631354ac7c9e2ab57857 100644 (file)
@@ -43,7 +43,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_okay;
   }
 #endif // _di_fl_directory_create_