X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Fmisc.c;h=5673dcedc46b7661ada0795e7539ce4a2afe9095;hb=2cbd767942c3768dac9547b15208e457490a738b;hp=b72fa146cd684385f84190b654cfd66b8a784233;hpb=c4e1a476135ce36417cdd797481feeaaff4301af;p=rocksndiamonds.git diff --git a/src/libgame/misc.c b/src/libgame/misc.c index b72fa146..5673dced 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -551,15 +551,18 @@ void Error(int mode, char *format, ...) { char *process_name = ""; FILE *error = stderr; + char *newline = "\n"; /* display warnings only when running in verbose mode */ if (mode & ERR_WARN && !options.verbose) return; #if !defined(PLATFORM_UNIX) + newline = "\r\n"; + if ((error = openErrorFile()) == NULL) { - printf("Cannot write to error output file!\n"); + printf("Cannot write to error output file!%s", newline); program.exit_function(1); } #endif @@ -584,15 +587,16 @@ void Error(int mode, char *format, ...) vfprintf(error, format, ap); va_end(ap); - fprintf(error, "\n"); + fprintf(error, "%s", newline); } if (mode & ERR_HELP) - fprintf(error, "%s: Try option '--help' for more information.\n", - program.command_basename); + fprintf(error, "%s: Try option '--help' for more information.%s", + program.command_basename, newline); if (mode & ERR_EXIT) - fprintf(error, "%s%s: aborting\n", program.command_basename, process_name); + fprintf(error, "%s%s: aborting%s", + program.command_basename, process_name, newline); if (error != stderr) fclose(error);