From 1b1b6fce174f764faacd3c0d1729d944c43a2f78 Mon Sep 17 00:00:00 2001 From: Michael Pfeiffer Date: Sat, 21 Mar 2009 10:23:34 +0000 Subject: [PATCH] Applied patch of ticket #3169 by oco: Set default partition correctly. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29626 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bootman/LegacyBootDrive.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/apps/bootman/LegacyBootDrive.cpp b/src/apps/bootman/LegacyBootDrive.cpp index 49f9e44bc4..1c60f9f2c0 100644 --- a/src/apps/bootman/LegacyBootDrive.cpp +++ b/src/apps/bootman/LegacyBootDrive.cpp @@ -322,6 +322,7 @@ LegacyBootDrive::WriteBootMenu(BMessage *settings) _CopyPartitionTable(newMBR, &oldMBR); int menuEntries = 0; + int defaultMenuEntry = 0; BMessage partition; int32 index; for (index = 0; settings->FindMessage("partition", index, &partition) == B_OK; index ++) { @@ -329,11 +330,13 @@ LegacyBootDrive::WriteBootMenu(BMessage *settings) partition.FindBool("show", &show); if (!show) continue; + if (index == defaultPartitionIndex) + defaultMenuEntry = menuEntries; menuEntries ++; } newBootLoader.WriteInt16(menuEntries); - newBootLoader.WriteInt16(defaultPartitionIndex); + newBootLoader.WriteInt16(defaultMenuEntry); newBootLoader.WriteInt16(timeout);