mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-11 21:52:53 +00:00
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.
This commit is contained in:
parent
3e326de8fa
commit
1a697f70db
Notes:
sideshowbarker
2024-07-19 13:37:43 +09:00
Author: https://github.com/bugaevc
Commit: 1a697f70db
Pull-request: https://github.com/SerenityOS/serenity/pull/227
Reviewed-by: https://github.com/awesomekling
3 changed files with 38 additions and 4 deletions
Kernel/FileSystem
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue