From: Kevin Day Date: Fri, 9 May 2025 02:23:39 +0000 (-0500) Subject: Bugfix: The fl_directory_create() is failing on directory exists with path ends in... X-Git-Url: https://git.kevux.org/?a=commitdiff_plain;h=efc107126a57a9dd6fe80c4d1778ed850b068159;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 bb0ac9a..faab68e 100644 --- a/level_1/fl_directory/c/directory.c +++ b/level_1/fl_directory/c/directory.c @@ -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_