summaryrefslogtreecommitdiff
path: root/Kernel/FileSystem
diff options
context:
space:
mode:
authorSergey Bugaev <bugaevc@gmail.com>2019-06-13 16:30:55 +0300
committerAndreas Kling <awesomekling@gmail.com>2019-06-14 06:24:02 +0200
commit1a697f70db770f630de74dc717d189067a89b0d7 (patch)
tree2d71bc6f7d540fb9890c1653938b2d06e4701757 /Kernel/FileSystem
parent3e326de8fa813f7eb88cb2a376f8168f21956cc6 (diff)
downloadserenity-1a697f70db770f630de74dc717d189067a89b0d7.zip
AK: Add more StringView utilities for making substrings.
These two allow making a new substring view starting from, or starting after, an existing substring view. Also make use of one of them in the kernel.
Diffstat (limited to 'Kernel/FileSystem')
-rw-r--r--Kernel/FileSystem/VirtualFileSystem.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/Kernel/FileSystem/VirtualFileSystem.cpp b/Kernel/FileSystem/VirtualFileSystem.cpp
index 5c68b50706..b4987089fd 100644
--- a/Kernel/FileSystem/VirtualFileSystem.cpp
+++ b/Kernel/FileSystem/VirtualFileSystem.cpp
@@ -714,10 +714,7 @@ KResultOr<Retained<Custody>> VFS::resolve_path(StringView path, Custody& base, R
if (!have_more_parts)
return symlink_target;
- const char* remaining_path_chars = parts[i + 1].characters();
- int remaining_path_length = path.length() - (remaining_path_chars - path.characters());
- StringView remaining_path { remaining_path_chars, remaining_path_length };
-
+ StringView remaining_path = path.substring_view_starting_from_substring(parts[i + 1]);
return resolve_path(remaining_path, *symlink_target.value(), parent_custody, options);
}
}