Skip to content

Commit b54764d

Browse files
authored
Merge pull request #806 from YBronst/master
Fixed a regression in the Volume display name function.
2 parents 9f94a91 + 5b1c2a8 commit b54764d

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

rEFIt_UEFI/Platform/Volume.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class REFIT_VOLUME {
6262

6363
const XStringW getVolLabelOrOSXVolumeNameOrVolName() {
6464
if ( VolLabel.notEmpty() ) return VolLabel;
65-
// if ( osxVolumeName.notEmpty() ) return osxVolumeName; // not assigned
65+
if ( osxVolumeName.notEmpty() ) return osxVolumeName;
6666
return VolName;
6767
}
6868
};

rEFIt_UEFI/entry_scan/loader.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,7 @@ STATIC XBool isFirstRootUUID(REFIT_VOLUME *Volume) {
466466
}
467467

468468
// Set Entry->VolName to .disk_label.contentDetails if it exists
469+
// Set Entry/Volume display name to .disk_label.contentDetails if it exists
469470
STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) {
470471
EFI_STATUS Status = EFI_NOT_FOUND;
471472
CONST CHAR16 *targetNameFile =
@@ -476,7 +477,10 @@ STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) {
476477
Status = egLoadFile(Entry->Volume->RootDir, targetNameFile,
477478
(UINT8 **)&fileBuffer, &fileLen);
478479
if (!EFI_ERROR(Status)) {
479-
Entry->DisplayedVolName.strncpy(fileBuffer, fileLen);
480+
if (Entry->DisplayedVolName.isEmpty()) {
481+
Entry->DisplayedVolName.strncpy(fileBuffer, fileLen);
482+
}
483+
Entry->Volume->osxVolumeName.strncpy(fileBuffer, fileLen);
480484
DBG("Created name:%ls\n", Entry->DisplayedVolName.wc_str());
481485

482486
FreePool(fileBuffer);

0 commit comments

Comments
 (0)