diff --git a/reactos/subsys/system/usetup/bootsup.c b/reactos/subsys/system/usetup/bootsup.c index eaa4645c4fc..77edba36ad3 100644 --- a/reactos/subsys/system/usetup/bootsup.c +++ b/reactos/subsys/system/usetup/bootsup.c @@ -388,7 +388,8 @@ UpdateFreeLoaderIni(PWCHAR IniPath, IniPath); Status = IniCacheLoad(&IniCache, - &Name); + &Name, + FALSE); if (!NT_SUCCESS(Status)) return(Status); @@ -1438,7 +1439,8 @@ UpdateBootIni(PWSTR BootIniPath, BootIniPath); Status = IniCacheLoad(&Cache, - &Name); + &Name, + FALSE); if (!NT_SUCCESS(Status)) { CHECKPOINT1; @@ -1487,4 +1489,4 @@ CHECKPOINT1; return(Status); } -/* EOF */ \ No newline at end of file +/* EOF */ diff --git a/reactos/subsys/system/usetup/inicache.c b/reactos/subsys/system/usetup/inicache.c index 990a263bf86..66a3e11c40a 100644 --- a/reactos/subsys/system/usetup/inicache.c +++ b/reactos/subsys/system/usetup/inicache.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: inicache.c,v 1.3 2003/01/28 17:29:22 ekohl Exp $ +/* $Id: inicache.c,v 1.4 2003/01/30 17:37:13 ekohl Exp $ * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS text-mode setup * FILE: subsys/system/usetup/inicache.c @@ -393,21 +393,42 @@ IniCacheGetKeyName(PCHAR Ptr, *NamePtr = NULL; *NameSize = 0; - /* skip whitespace */ - while (*Ptr != 0 && isspace(*Ptr)) + while(Ptr && *Ptr) + { + *NamePtr = NULL; + *NameSize = 0; + Size = 0; + + /* skip whitespace and empty lines */ + while (isspace(*Ptr) || *Ptr == '\n' || *Ptr == '\r') { Ptr++; } + if (*Ptr == 0) + { + continue; + } - *NamePtr = Ptr; + *NamePtr = Ptr; - while (*Ptr != 0 && !isspace(*Ptr) && *Ptr != '=') + while (*Ptr != 0 && !isspace(*Ptr) && *Ptr != '=' && *Ptr != ';') { Size++; Ptr++; } - - *NameSize = Size; + if (*Ptr == ';') + { + while (*Ptr != 0 && *Ptr != '\r' && *Ptr != '\n') + { + Ptr++; + } + } + else + { + *NameSize = Size; + break; + } + } return(Ptr); } @@ -416,7 +437,8 @@ IniCacheGetKeyName(PCHAR Ptr, static PCHAR IniCacheGetKeyValue(PCHAR Ptr, PCHAR *DataPtr, - PULONG DataSize) + PULONG DataSize, + BOOL String) { ULONG Size = 0; @@ -442,12 +464,32 @@ IniCacheGetKeyValue(PCHAR Ptr, Ptr++; } - /* Get data */ - *DataPtr = Ptr; - while (*Ptr != 0 && *Ptr != '\r') + if (*Ptr == '"' && String) { Ptr++; - Size++; + + /* Get data */ + *DataPtr = Ptr; + while (*Ptr != '"') + { + Ptr++; + Size++; + } + Ptr++; + while (*Ptr && *Ptr != '\r' && *Ptr != '\n') + { + Ptr++; + } + } + else + { + /* Get data */ + *DataPtr = Ptr; + while (*Ptr != 0 && *Ptr != '\r' && *Ptr != ';') + { + Ptr++; + Size++; + } } /* Skip to next line */ @@ -468,7 +510,8 @@ IniCacheGetKeyValue(PCHAR Ptr, NTSTATUS IniCacheLoad(PINICACHE *Cache, - PUNICODE_STRING FileName) + PUNICODE_STRING FileName, + BOOL String) { OBJECT_ATTRIBUTES ObjectAttributes; FILE_STANDARD_INFORMATION FileInfo; @@ -615,6 +658,8 @@ IniCacheLoad(PINICACHE *Cache, &SectionName, &SectionNameSize); + DPRINT1("[%.*s]\n", SectionNameSize, SectionName); + Section = IniCacheAddSection(*Cache, SectionName, SectionNameSize); @@ -639,7 +684,10 @@ IniCacheLoad(PINICACHE *Cache, Ptr = IniCacheGetKeyValue(Ptr, &KeyValue, - &KeyValueSize); + &KeyValueSize, + String); + + DPRINT1("'%.*s' = '%.*s'\n", KeyNameSize, KeyName, KeyValueSize, KeyValue); Key = IniCacheAddKey(Section, KeyName, diff --git a/reactos/subsys/system/usetup/inicache.h b/reactos/subsys/system/usetup/inicache.h index c25c846bd5b..e22a8acd89f 100644 --- a/reactos/subsys/system/usetup/inicache.h +++ b/reactos/subsys/system/usetup/inicache.h @@ -77,7 +77,8 @@ typedef enum NTSTATUS IniCacheLoad(PINICACHE *Cache, - PUNICODE_STRING FileName); + PUNICODE_STRING FileName, + BOOL String); VOID IniCacheDestroy(PINICACHE Cache); diff --git a/reactos/subsys/system/usetup/usetup.c b/reactos/subsys/system/usetup/usetup.c index 5ddff3d9399..7aecaeff03f 100644 --- a/reactos/subsys/system/usetup/usetup.c +++ b/reactos/subsys/system/usetup/usetup.c @@ -404,7 +404,8 @@ StartPage(PINPUT_RECORD Ir) IniCache = NULL; Status = IniCacheLoad(&IniCache, - &FileName); + &FileName, + TRUE); if (!NT_SUCCESS(Status)) { PopupError("Setup failed to load the file TXTSETUP.SIF.\n", @@ -478,24 +479,6 @@ StartPage(PINPUT_RECORD Ir) } } -#if 0 - PopupError("This is a test error.", "ENTER = Reboot computer"); - - SetStatusText(" ENTER = Continue"); - - while(TRUE) - { - ConInKey(Ir); - - if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */ - { - return(INTRO_PAGE); - } - } - - return(START_PAGE); -#endif - return(INTRO_PAGE); }