Fix log message "Can't load language file ""\'

This commit is contained in:
Stas Degteff 2007-03-21 08:07:21 +00:00
parent 3297c30a08
commit 45fe7eaf7e

View File

@ -669,6 +669,13 @@ void LoadLanguage(const char* file)
int line = 0; int line = 0;
char buf[256]; char buf[256];
if (file==NULL || *file==0){
LOG.printf("! LoadLanguage() is called with empty file name!");
#if defined(GFTRK_ENABLE)
__gftrk_log();
#endif
return;
}
gfile fp(AddPath(CFG->goldpath, file), "rt", CFG->sharemode); gfile fp(AddPath(CFG->goldpath, file), "rt", CFG->sharemode);
if (fp.isopen()) if (fp.isopen())
{ {
@ -704,7 +711,7 @@ void LoadLanguage(const char* file)
AssignDateNames(); AssignDateNames();
} }
else else
LOG.printf("Can't load language file \"%s\", OS reports: %s!", file, strerror(errno)); LOG.printf("? Can't load language file \"%s\", OS reports: %s!", file, strerror(errno));
} }