UiDrawProgressBarCenter(1, 100, "Loading ReactOS Setup...");
/* Read the system path is set in the .ini file */
+ BootPath[0] = ANSI_NULL;
if (!HasSection || !IniReadSettingByName(SectionId, "SystemPath", BootPath, sizeof(BootPath)))
{
/*
if ((strlen(BootPath) == 0) || BootPath[strlen(BootPath) - 1] != '\\')
strcat(BootPath, "\\");
- /* Read booting options */
+ /* Read boot options */
+ BootOptions2[0] = ANSI_NULL;
if (!HasSection || !IniReadSettingByName(SectionId, "Options", BootOptions2, sizeof(BootOptions2)))
{
- /* Get options after the title */
+ /* Retrieve the options after the quoted title */
PCSTR p = SettingsValue;
- while (*p == ' ' || *p == '"')
- p++;
- while (*p != '\0' && *p != '"')
- p++;
+
+ /* Trim any leading whitespace and quotes */
+ while (*p == ' ' || *p == '\t' || *p == '"')
+ ++p;
+ /* Skip all the text up to the first last quote */
+ while (*p != ANSI_NULL && *p != '"')
+ ++p;
+ /* Trim any trailing whitespace and quotes */
+ while (*p == ' ' || *p == '\t' || *p == '"')
+ ++p;
+
strcpy(BootOptions2, p);
TRACE("BootOptions: '%s'\n", BootOptions2);
}
{
ULONG_PTR SectionId;
PCSTR SectionName = OperatingSystem->SystemPartition;
- CHAR SettingsValue[80];
+ PCHAR File;
+ BOOLEAN Success;
BOOLEAN HasSection;
+ CHAR SettingsValue[80];
CHAR BootPath[MAX_PATH];
CHAR FileName[MAX_PATH];
CHAR BootOptions[256];
- PCHAR File;
- BOOLEAN Success;
PLOADER_PARAMETER_BLOCK LoaderBlock;
/* Get OS setting value */
UiDrawProgressBarCenter(1, 100, "Loading NT...");
/* Read the system path is set in the .ini file */
+ BootPath[0] = ANSI_NULL;
if (!HasSection || !IniReadSettingByName(SectionId, "SystemPath", BootPath, sizeof(BootPath)))
{
strcpy(BootPath, SectionName);
if ((BootPath[0] == 0) || BootPath[strlen(BootPath) - 1] != '\\')
strcat(BootPath, "\\");
- /* Read booting options */
+ /* Read boot options */
+ BootOptions[0] = ANSI_NULL;
if (!HasSection || !IniReadSettingByName(SectionId, "Options", BootOptions, sizeof(BootOptions)))
{
- /* Get options after the title */
+ /* Retrieve the options after the quoted title */
PCSTR p = SettingsValue;
- while (*p == ' ' || *p == '"')
- p++;
- while (*p != '\0' && *p != '"')
- p++;
+
+ /* Trim any leading whitespace and quotes */
+ while (*p == ' ' || *p == '\t' || *p == '"')
+ ++p;
+ /* Skip all the text up to the first last quote */
+ while (*p != ANSI_NULL && *p != '"')
+ ++p;
+ /* Trim any trailing whitespace and quotes */
+ while (*p == ' ' || *p == '\t' || *p == '"')
+ ++p;
+
strcpy(BootOptions, p);
TRACE("BootOptions: '%s'\n", BootOptions);
}