From: Kevin Day Date: Fri, 9 May 2025 02:28:08 +0000 (-0500) Subject: Bugfix: The fl_directory_create() is failing on directory exists with path ends in... X-Git-Tag: 0.6.14~5 X-Git-Url: https://www.git.kevux.org/?a=commitdiff_plain;h=5f3f3b9dc72c97f77e96aebb1f90eed8f43d90c9;p=fll Bugfix: The fl_directory_create() is failing on directory exists with path ends in '/'. 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. --- diff --git a/level_1/fl_directory/c/directory.c b/level_1/fl_directory/c/directory.c index 23cb7b2..e94d991 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -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_