Browse Source

Let's properly report an invalid filename instead of reporting file not found.

Godzil 1 year ago
parent
commit
49f2cba7f4
1 changed files with 4 additions and 1 deletions
  1. 4 1
      miniffs.c

+ 4 - 1
miniffs.c

@@ -29,7 +29,10 @@ file_t *miniffs_open(miniffs_t *fs, const char *filename)
     ret->fent = miniffs_findfile(fs, filename);
     if (!ret->fent)
     {
-        miniffs_seterror(MINIFFS_FILE_NOT_FOUND);
+        if (miniffs_geterror() != MINIFFS_INVALID_NAME)
+        {
+            miniffs_seterror(MINIFFS_FILE_NOT_FOUND);
+        }
         goto free_and_exit;
     }