summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-10-09 14:20:55 +0200
committerkobewi <kobewi4e@gmail.com>2022-10-09 14:22:13 +0200
commit785e5880b3c986d010fcb745da0238ad333094f4 (patch)
tree0f1e42ac55232ee6df7b1cca56988d579e225f4a /core
parent880a0177d12463b612268afe95bd3d8dd565bf52 (diff)
Fix simplify_path() breaking uid://
Diffstat (limited to 'core')
-rw-r--r--core/string/ustring.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp
index 6218c21cde..dbbcedca84 100644
--- a/core/string/ustring.cpp
+++ b/core/string/ustring.cpp
@@ -3669,13 +3669,16 @@ String String::simplify_path() const {
String drive;
if (s.begins_with("local://")) {
drive = "local://";
- s = s.substr(8, s.length());
+ s = s.substr(8);
} else if (s.begins_with("res://")) {
drive = "res://";
- s = s.substr(6, s.length());
+ s = s.substr(6);
} else if (s.begins_with("user://")) {
drive = "user://";
- s = s.substr(7, s.length());
+ s = s.substr(7);
+ } else if (s.begins_with("uid://")) {
+ drive = "uid://";
+ s = s.substr(6);
} else if (is_network_share_path()) {
drive = s.substr(0, 2);
s = s.substr(2, s.length() - 2);
@@ -3689,7 +3692,7 @@ String String::simplify_path() const {
}
if (p != -1 && p < s.find("/")) {
drive = s.substr(0, p + 2);
- s = s.substr(p + 2, s.length());
+ s = s.substr(p + 2);
}
}