mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-21 10:26:06 +03:00
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.
This commit is contained in:
parent
8242d72271
commit
b4d2ab102b
@ -52,7 +52,7 @@ FileImplPtr LittleFSImpl::open(const char* path, OpenMode openMode, AccessMode a
|
|||||||
int flags = _getFlags(openMode, accessMode);
|
int flags = _getFlags(openMode, accessMode);
|
||||||
auto fd = std::make_shared<lfs_file_t>();
|
auto fd = std::make_shared<lfs_file_t>();
|
||||||
|
|
||||||
if ((openMode && OM_CREATE) && strchr(path, '/')) {
|
if ((openMode & OM_CREATE) && strchr(path, '/')) {
|
||||||
// For file creation, silently make subdirs as needed. If any fail,
|
// For file creation, silently make subdirs as needed. If any fail,
|
||||||
// it will be caught by the real file open later on
|
// it will be caught by the real file open later on
|
||||||
char *pathStr = strdup(path);
|
char *pathStr = strdup(path);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user