From 25059d28dfe4d19d5aefda10a7cb7543ac88e17e Mon Sep 17 00:00:00 2001 From: Darkvater Date: Wed, 17 Jan 2007 00:05:51 +0000 Subject: [PATCH] (svn r8172) -Backport from trunk (r8013, r8134): - Show error messages about our own data files as ShowInfo(F) and output console error to stderr and not stdout. --- gfxinit.c | 4 ++-- music_gui.c | 2 +- openttd.c | 3 +-- settings.c | 4 ++-- unix.c | 2 +- win32.c | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/gfxinit.c b/gfxinit.c index fc3d28008d..a74074268c 100644 --- a/gfxinit.c +++ b/gfxinit.c @@ -174,11 +174,11 @@ void CheckExternalFiles(void) for (i = 0; i < 3; i++) if (FileMD5(files_win.landscape[i], true)) win++; if (!FileMD5(sample_cat_win, false) && !FileMD5(sample_cat_dos, false)) - fprintf(stderr, "Your sample.cat file is corrupted or missing!\n"); + ShowInfo("Your 'sample.cat' file is corrupted or missing!"); for (i = 0; i < lengthof(files_openttd); i++) { if (!FileMD5(files_openttd[i], false)) { - fprintf(stderr, "Your %s file is corrupted or missing!\n", files_openttd[i].filename); + ShowInfoF("Your '%s' file is corrupted or missing!", files_openttd[i].filename); } } diff --git a/music_gui.c b/music_gui.c index 84a6324c29..37cd3fa798 100644 --- a/music_gui.c +++ b/music_gui.c @@ -288,7 +288,7 @@ static void MusicTrackSelectionWndProc(Window *w, WindowEvent *e) #if 0 case 12: // save - ShowInfo("MusicTrackSelectionWndProc:save not implemented\n"); + ShowInfo("MusicTrackSelectionWndProc:save not implemented"); break; #endif diff --git a/openttd.c b/openttd.c index 7b02e6ceef..e4e44a6f17 100644 --- a/openttd.c +++ b/openttd.c @@ -157,8 +157,7 @@ static void showhelp(void) #endif " -i = Force to use the DOS palette\n" " (use this if you see a lot of pink)\n" - " -c config_file = Use 'config_file' instead of 'openttd.cfg'\n" - "\n", + " -c config_file = Use 'config_file' instead of 'openttd.cfg'\n", lastof(buf) ); diff --git a/settings.c b/settings.c index af40febfad..20a2155735 100644 --- a/settings.c +++ b/settings.c @@ -247,7 +247,7 @@ static IniFile *ini_load(const char *filename) // it's a group? if (s[0] == '[') { if (e[-1] != ']') { - ShowInfoF("ini: invalid group name '%s'\n", buffer); + ShowInfoF("ini: invalid group name '%s'", buffer); } else { e--; } @@ -282,7 +282,7 @@ static IniFile *ini_load(const char *filename) item->value = pool_strdup(&ini->pool, t, e - t); } else { // it's an orphan item - ShowInfoF("ini: '%s' outside of group\n", buffer); + ShowInfoF("ini: '%s' outside of group", buffer); } } diff --git a/unix.c b/unix.c index c40cbafe2f..c4ba502432 100644 --- a/unix.c +++ b/unix.c @@ -111,7 +111,7 @@ static void ChangeWorkingDirectory(char *exe) void ShowInfo(const char *str) { - puts(str); + fprintf(stderr, "%s\n", str); } void ShowOSErrorBox(const char *buf) diff --git a/win32.c b/win32.c index fc68e4afc2..2b6a4f696a 100644 --- a/win32.c +++ b/win32.c @@ -836,7 +836,7 @@ void CreateConsole(void) void ShowInfo(const char *str) { if (_has_console) { - puts(str); + fprintf(stderr, "%s\n", str); } else { bool old;