OpenCoreMisc: Fix parsing Enabled in Tools section

This commit is contained in:
vit9696 2019-06-11 00:04:20 +03:00 committed by GitHub
parent d57d461a82
commit 70098677bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -322,7 +322,7 @@ OcMiscBoot (
OC_PICKER_CONTEXT *Context;
UINTN ContextSize;
UINT32 Index;
UINT32 ToolCount;
UINT32 ToolIndex;
//
// Do not use our boot picker unless asked.
@ -358,17 +358,15 @@ OcMiscBoot (
Context->CustomEntryContext = Storage;
Context->CustomRead = OcToolLoadEntry;
ToolCount = 0;
for (Index = 0; Index < Context->CustomEntryCount; ++Index) {
for (Index = 0, ToolIndex = 0; Index < Config->Misc.Tools.Count; ++Index) {
if (Config->Misc.Tools.Values[Index]->Enabled) {
Context->CustomEntries[Index].Name = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Name);
Context->CustomEntries[Index].Path = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Path);
++ToolCount;
Context->CustomEntries[ToolIndex].Name = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Name);
Context->CustomEntries[ToolIndex].Path = OC_BLOB_GET (&Config->Misc.Tools.Values[Index]->Path);
++ToolIndex;
}
}
Context->CustomEntryCount = ToolCount;
Context->CustomEntryCount = ToolIndex;
Status = OcRunSimpleBootPicker (
Context