From 349ce35386aee70fdc9d323514228e529d9c1816 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Thu, 15 May 2014 19:42:50 -0400 Subject: [PATCH] Fixed bug that could cause rEFInd to fail to detect boot loaders in the root directory of a partition. --- NEWS.txt | 3 +++ refind/main.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/NEWS.txt b/NEWS.txt index 2bf51dc..d9d52da 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -1,6 +1,9 @@ 0.8.1 (5/??/2014): ------------------ +- Fixed bug that could cause rEFInd to fail to detect boot loaders stored + on the root directory of a partition. + - Added two new bitmap fonts to those distributed with rEFInd: Ubuntu Mono and Nimbus Mono. Both come in 12-, 14-, 16-, and 24-point sizes. diff --git a/refind/main.c b/refind/main.c index 51288d2..5ef09c5 100644 --- a/refind/main.c +++ b/refind/main.c @@ -168,7 +168,7 @@ static VOID AboutrEFInd(VOID) if (AboutMenu.EntryCount == 0) { AboutMenu.TitleImage = BuiltinIcon(BUILTIN_ICON_FUNC_ABOUT); - AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.0.6"); + AddMenuInfoLine(&AboutMenu, L"rEFInd Version 0.8.0.7"); AddMenuInfoLine(&AboutMenu, L""); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2006-2010 Christoph Pfisterer"); AddMenuInfoLine(&AboutMenu, L"Copyright (c) 2012-2014 Roderick W. Smith"); @@ -1248,9 +1248,12 @@ static BOOLEAN HasSignedCounterpart(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN MergeStrings(&NewFile, Path, 0); MergeStrings(&NewFile, Filename, L'\\'); MergeStrings(&NewFile, L".efi.signed", 0); - if (FileExists(Volume->RootDir, NewFile)) - retval = TRUE; - MyFreePool(NewFile); + if (NewFile != NULL) { + CleanUpPathNameSlashes(NewFile); + if (FileExists(Volume->RootDir, NewFile)) + retval = TRUE; + MyFreePool(NewFile); + } // if return retval; } // BOOLEAN HasSignedCounterpart() @@ -1270,8 +1273,7 @@ static BOOLEAN ScanLoaderDir(IN REFIT_VOLUME *Volume, IN CHAR16 *Path, IN CHAR16 BOOLEAN FoundFallbackDuplicate = FALSE; if ((!SelfDirPath || !Path || ((StriCmp(Path, SelfDirPath) == 0) && (Volume->DeviceHandle != SelfVolume->DeviceHandle)) || - (StriCmp(Path, SelfDirPath) != 0)) && - (ShouldScan(Volume, Path))) { + (StriCmp(Path, SelfDirPath) != 0)) && (ShouldScan(Volume, Path))) { // look through contents of the directory DirIterOpen(Volume->RootDir, Path, &DirIter); while (DirIterNext(&DirIter, 2, Pattern, &DirEntry)) { -- 2.39.2