mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
Kernel: Replace {KString => String}::formatted in determine_boot_device
This commit is contained in:
parent
ec1f3abd34
commit
6402840670
Notes:
sideshowbarker
2024-07-17 21:01:13 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/64028406700 Pull-request: https://github.com/SerenityOS/serenity/pull/11848 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/bgianfo ✅
1 changed files with 7 additions and 4 deletions
|
@ -145,11 +145,14 @@ UNMAP_AFTER_INIT void StorageManagement::determine_boot_device()
|
|||
// number in the device name indicates the node, e.g. /dev/nvme0n1 we need to append a "p" character
|
||||
// so that we can properly distinguish the partition index from the device itself
|
||||
char storage_name_last_char = *(storage_device.early_storage_name().end() - 1);
|
||||
String early_storage_name;
|
||||
if (storage_name_last_char >= '0' && storage_name_last_char <= '9')
|
||||
early_storage_name = String::formatted("{}p", storage_device.early_storage_name());
|
||||
else
|
||||
OwnPtr<KString> normalized_name;
|
||||
StringView early_storage_name;
|
||||
if (storage_name_last_char >= '0' && storage_name_last_char <= '9') {
|
||||
normalized_name = MUST(KString::formatted("{}p", storage_device.early_storage_name()));
|
||||
early_storage_name = normalized_name->view();
|
||||
} else {
|
||||
early_storage_name = storage_device.early_storage_name();
|
||||
}
|
||||
|
||||
auto start_storage_name = storage_name.substring_view(0, min(early_storage_name.length(), storage_name.length()));
|
||||
|
||||
|
|
Loading…
Reference in a new issue