From 927ab9996d5f19e0a1a54472acb4f53c6d14fb9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Thu, 5 Feb 2015 21:17:35 +0000 Subject: [PATCH] [FREELDR]: Fix initialization of BootPath variable, and add some explanation comment as requested long time ago by Pierre. svn path=/trunk/; revision=66173 --- reactos/boot/freeldr/freeldr/windows/setupldr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reactos/boot/freeldr/freeldr/windows/setupldr.c b/reactos/boot/freeldr/freeldr/windows/setupldr.c index 497819ced48..d37c04e91ec 100644 --- a/reactos/boot/freeldr/freeldr/windows/setupldr.c +++ b/reactos/boot/freeldr/freeldr/windows/setupldr.c @@ -183,8 +183,16 @@ LoadReactOSSetup(IN OperatingSystemItem* OperatingSystem, if (!HasSection || !IniReadSettingByName(SectionId, "SystemPath", BootPath, sizeof(BootPath))) { + /* + * IMPROVE: I don't want to call MachDiskGetBootPath here as a + * default choice because I can call it after (see few lines below). + * Also doing the strcpy call as it is done in winldr.c is not + * really what we want. Instead I reset BootPath here so that + * we can build the full path using the general code from below. + */ // MachDiskGetBootPath(BootPath, sizeof(BootPath)); // strcpy(BootPath, SectionName); + BootPath[0] = '\0'; } /* @@ -239,7 +247,7 @@ LoadReactOSSetup(IN OperatingSystemItem* OperatingSystem, /* Load the ramdisk */ if (!RamDiskLoadVirtualFile(FileName)) { - UiMessageBox("Failed to load RAM disk file %s\n", FileName); + UiMessageBox("Failed to load RAM disk file %s", FileName); return; } } @@ -256,7 +264,7 @@ LoadReactOSSetup(IN OperatingSystemItem* OperatingSystem, SystemPath = SourcePaths[i]; if (!SystemPath) { - UiMessageBox("Failed to open txtsetup.sif\n"); + UiMessageBox("Failed to open txtsetup.sif"); return; } strcpy(File, SystemPath);