From: James Bunton Date: Mon, 13 Mar 2017 09:35:27 +0000 (+1100) Subject: Don't choose an initrd which has no characters in common with the kernel X-Git-Url: https://code.delx.au/refind/commitdiff_plain/cbe9257ed1e75977e6744ff6171ed70cb079c338 Don't choose an initrd which has no characters in common with the kernel --- diff --git a/refind/main.c b/refind/main.c index eeb7719..22415e8 100644 --- a/refind/main.c +++ b/refind/main.c @@ -584,7 +584,7 @@ static CHAR16 * FindInitrd(IN CHAR16 *LoaderPath, IN REFIT_VOLUME *Volume) { KernelPostNum = MyStrStr(LoaderPath, KernelVersion); InitrdPostNum = MyStrStr(CurrentInitrdName->Value, KernelVersion); SharedChars = NumCharsInCommon(KernelPostNum, InitrdPostNum); - if (SharedChars > MaxSharedChars) { + if (SharedChars > MaxSharedChars && SharedChars > 0) { MaxSharedChars = SharedChars; MaxSharedInitrd = CurrentInitrdName; } // if