Skip to content

Fix empty directory checks with wildcard find API#87

Open
Old-Ding wants to merge 1 commit into
FreeRTOS:mainfrom
Old-Ding:codex/fix-rmdir-wildcard-empty-dir
Open

Fix empty directory checks with wildcard find API#87
Old-Ding wants to merge 1 commit into
FreeRTOS:mainfrom
Old-Ding:codex/fix-rmdir-wildcard-empty-dir

Conversation

@Old-Ding

@Old-Ding Old-Ding commented Jul 1, 2026

Copy link
Copy Markdown

Closes #66

Summary

  • Update FF_isDirEmpty() so it enumerates the target directory contents directly.
  • Avoid calling FF_FindFirst() for the emptiness check, because wildcard mode treats a path without a trailing separator as the directory entry itself.
  • Preserve the documented FF_FindFirst() wildcard semantics for public callers.

Testing

  • git diff --check upstream/main...HEAD
  • Verified the touched file uses CRLF line endings and has no UTF-8 BOM.
  • Not run: FreeRTOS+FAT unit tests, because this Windows host does not have cmake, Ruby, or a C compiler installed.

@Old-Ding Old-Ding marked this pull request as ready for review July 1, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Unable to remove directory if ffconfigFINDAPI_ALLOW_WILDCARDS is enabled.

2 participants