mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-03 17:59:16 +00:00
[FL-1799] Require the trailing slash for root paths (#2486)
* Require the trailing slash * Fix the swapped storages * Fix root paths
This commit is contained in:
parent
d8385b7f91
commit
9fbf327028
1 changed files with 16 additions and 6 deletions
|
@ -33,12 +33,22 @@ static StorageType storage_get_type_by_path(FuriString* path) {
|
||||||
StorageType type = ST_ERROR;
|
StorageType type = ST_ERROR;
|
||||||
const char* path_cstr = furi_string_get_cstr(path);
|
const char* path_cstr = furi_string_get_cstr(path);
|
||||||
|
|
||||||
if(memcmp(path_cstr, STORAGE_EXT_PATH_PREFIX, strlen(STORAGE_EXT_PATH_PREFIX)) == 0) {
|
if(furi_string_size(path) == 4) {
|
||||||
type = ST_EXT;
|
if(memcmp(path_cstr, STORAGE_EXT_PATH_PREFIX, strlen(STORAGE_EXT_PATH_PREFIX)) == 0) {
|
||||||
} else if(memcmp(path_cstr, STORAGE_INT_PATH_PREFIX, strlen(STORAGE_INT_PATH_PREFIX)) == 0) {
|
type = ST_EXT;
|
||||||
type = ST_INT;
|
} else if(memcmp(path_cstr, STORAGE_INT_PATH_PREFIX, strlen(STORAGE_INT_PATH_PREFIX)) == 0) {
|
||||||
} else if(memcmp(path_cstr, STORAGE_ANY_PATH_PREFIX, strlen(STORAGE_ANY_PATH_PREFIX)) == 0) {
|
type = ST_INT;
|
||||||
type = ST_ANY;
|
} else if(memcmp(path_cstr, STORAGE_ANY_PATH_PREFIX, strlen(STORAGE_ANY_PATH_PREFIX)) == 0) {
|
||||||
|
type = ST_ANY;
|
||||||
|
}
|
||||||
|
} else if(furi_string_size(path) > 4) {
|
||||||
|
if(memcmp(path_cstr, EXT_PATH(""), strlen(EXT_PATH(""))) == 0) {
|
||||||
|
type = ST_EXT;
|
||||||
|
} else if(memcmp(path_cstr, INT_PATH(""), strlen(INT_PATH(""))) == 0) {
|
||||||
|
type = ST_INT;
|
||||||
|
} else if(memcmp(path_cstr, ANY_PATH(""), strlen(ANY_PATH(""))) == 0) {
|
||||||
|
type = ST_ANY;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
|
|
Loading…
Reference in a new issue