From 0b581f1924a6dae96e42b9a15c939c250a421fee Mon Sep 17 00:00:00 2001 From: Sjoerd van der Berg Date: Sat, 19 Oct 2002 15:48:27 +0000 Subject: [PATCH] Low case propery names and extra protection against NULL string for file name Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@350 --- src/misc/messages.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/misc/messages.cpp b/src/misc/messages.cpp index c2da9d54..9df0ea1e 100644 --- a/src/misc/messages.cpp +++ b/src/misc/messages.cpp @@ -58,6 +58,7 @@ void MSG_Replace(const char * _name, const char* _val) { MSG_Add(_name,_val); } static void LoadMessageFile(const char * fname) { + if (!fname) return; if(*fname=='\0') return;//empty string=no languagefile FILE * mfile=fopen(fname,"rb"); /* This should never happen and since other modules depend on this use a normal printf */ @@ -119,9 +120,8 @@ void MSG_Write(const char * location) { } void MSG_Init(Section_prop * section) { - /* Load the messages from "dosbox.lang file" */ std::string file_name; if (control->cmdline->FindString("-lang",file_name)) { LoadMessageFile(file_name.c_str()); - } else LoadMessageFile(section->Get_string("LANGUAGE")); + } else LoadMessageFile(section->Get_string("language")); }