diff --git a/rEFIt_UEFI/Platform/Volume.h b/rEFIt_UEFI/Platform/Volume.h index 1024c3a1a..5210f8518 100644 --- a/rEFIt_UEFI/Platform/Volume.h +++ b/rEFIt_UEFI/Platform/Volume.h @@ -62,7 +62,7 @@ class REFIT_VOLUME { const XStringW getVolLabelOrOSXVolumeNameOrVolName() { if ( VolLabel.notEmpty() ) return VolLabel; -// if ( osxVolumeName.notEmpty() ) return osxVolumeName; // not assigned + if ( osxVolumeName.notEmpty() ) return osxVolumeName; return VolName; } }; diff --git a/rEFIt_UEFI/entry_scan/loader.cpp b/rEFIt_UEFI/entry_scan/loader.cpp index 1a51313ea..a14027c1b 100644 --- a/rEFIt_UEFI/entry_scan/loader.cpp +++ b/rEFIt_UEFI/entry_scan/loader.cpp @@ -466,6 +466,7 @@ STATIC XBool isFirstRootUUID(REFIT_VOLUME *Volume) { } // Set Entry->VolName to .disk_label.contentDetails if it exists +// Set Entry/Volume display name to .disk_label.contentDetails if it exists STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) { EFI_STATUS Status = EFI_NOT_FOUND; CONST CHAR16 *targetNameFile = @@ -476,7 +477,10 @@ STATIC EFI_STATUS GetOSXVolumeName(LOADER_ENTRY *Entry) { Status = egLoadFile(Entry->Volume->RootDir, targetNameFile, (UINT8 **)&fileBuffer, &fileLen); if (!EFI_ERROR(Status)) { - Entry->DisplayedVolName.strncpy(fileBuffer, fileLen); + if (Entry->DisplayedVolName.isEmpty()) { + Entry->DisplayedVolName.strncpy(fileBuffer, fileLen); + } + Entry->Volume->osxVolumeName.strncpy(fileBuffer, fileLen); DBG("Created name:%ls\n", Entry->DisplayedVolName.wc_str()); FreePool(fileBuffer);