From b7088bb6e6f1a18b209df27ab3cfee0b2241a630 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Mon, 20 Jan 2003 20:01:49 +0000 Subject: [PATCH] doesn't crash on old configfiles anymore Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@650 --- src/misc/setup.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/misc/setup.cpp b/src/misc/setup.cpp index 76f64269..544ad6d9 100644 --- a/src/misc/setup.cpp +++ b/src/misc/setup.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2002 The DOSBox Team + * Copyright (C) 2002-2003 The DOSBox Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -222,7 +222,8 @@ void Config::ParseConfigFile(const char* configfilename){ return; } char gegevens[150]; - Section* currentsection; + Section* currentsection = NULL; + Section* testsec = NULL; while (in) { in.getline(gegevens,150); char* temp; @@ -237,7 +238,9 @@ void Config::ParseConfigFile(const char* configfilename){ case '[': temp = strrchr(gegevens,']'); *temp=0; - currentsection=GetSection(&gegevens[1]); + testsec = GetSection(&gegevens[1]); + if(testsec != NULL ) currentsection = testsec; + testsec = NULL; break; default: try{