mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-07-31 02:23:04 -07:00
Merge remote-tracking branch 'ofw/dev' into mntm-dev --nobuild
This commit is contained in:
@@ -757,11 +757,23 @@ void storage_process_message_internal(Storage* app, StorageMessage* message) {
|
||||
storage_path_trim_trailing_slashes(path2);
|
||||
storage_process_alias(app, path1, message->data->cequivpath.thread_id, false);
|
||||
storage_process_alias(app, path2, message->data->cequivpath.thread_id, false);
|
||||
// Comparison is done on path name, same beginning of name != same file/folder
|
||||
// Check with a / suffixed to ensure same file/folder name
|
||||
furi_string_cat(path1, "/");
|
||||
furi_string_cat(path2, "/");
|
||||
if(message->data->cequivpath.truncate) {
|
||||
if(message->data->cequivpath.check_subdir) {
|
||||
// by appending slashes at the end and then truncating the second path, we can
|
||||
// effectively check for shared path components:
|
||||
// example 1:
|
||||
// path1: "/ext/blah" -> "/ext/blah/" -> "/ext/blah/"
|
||||
// path2: "/ext/blah-blah" -> "/ect/blah-blah/" -> "/ext/blah-"
|
||||
// results unequal, conclusion: path2 is not a subpath of path1
|
||||
// example 2:
|
||||
// path1: "/ext/blah" -> "/ext/blah/" -> "/ext/blah/"
|
||||
// path2: "/ext/blah/blah" -> "/ect/blah/blah/" -> "/ext/blah/"
|
||||
// results equal, conclusion: path2 is a subpath of path1
|
||||
// example 3:
|
||||
// path1: "/ext/blah/blah" -> "/ect/blah/blah/" -> "/ext/blah/blah/"
|
||||
// path2: "/ext/blah" -> "/ext/blah/" -> "/ext/blah/"
|
||||
// results unequal, conclusion: path2 is not a subpath of path1
|
||||
furi_string_push_back(path1, '/');
|
||||
furi_string_push_back(path2, '/');
|
||||
furi_string_left(path2, furi_string_size(path1));
|
||||
}
|
||||
message->return_data->bool_value =
|
||||
|
||||
Reference in New Issue
Block a user