Skip to content

Commit b4d2ab1

Browse files
Fix boolean/logical & mixup in LittleFS open (#6996)
To mimic SPIFFs behavior, we automatically create subdirectories when a file is opened in a subdir. The check mixed up a bitmask check with a boolean AND. Fix it.
1 parent 8242d72 commit b4d2ab1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: libraries/LittleFS/src/LittleFS.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ FileImplPtr LittleFSImpl::open(const char* path, OpenMode openMode, AccessMode a
5252
int flags = _getFlags(openMode, accessMode);
5353
auto fd = std::make_shared<lfs_file_t>();
5454

55-
if ((openMode && OM_CREATE) && strchr(path, '/')) {
55+
if ((openMode & OM_CREATE) && strchr(path, '/')) {
5656
// For file creation, silently make subdirs as needed. If any fail,
5757
// it will be caught by the real file open later on
5858
char *pathStr = strdup(path);

0 commit comments

Comments
 (0)