From a3b216e475644b5b33031e710d9dea315078b3e7 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Tue, 2 May 2006 22:10:54 +0000 Subject: [PATCH] work around win32 rumor issues (#H80) With makedefs changed to open the files as binary, the rumors generation and retrieval seems to work consistently. win32tty T start=000067 (000043), end=020658 (0050b2), size=020591 (00506f) F start=020658 (0050b2), end=043641 (00aa79), size=022983 (0059c7) T 000067 A blindfold can be very useful if you're telepathic. F 020658 "So when I die, the first thing I will see in heaven is a score list?" win32gui T start=000067 (000043), end=020658 (0050b2), size=020591 (00506f) F start=020658 (0050b2), end=043641 (00aa79), size=022983 (0059c7) T 000067 A blindfold can be very useful if you're telepathic. F 020658 "So when I die, the first thing I will see in heaven is a score list?" --- util/makedefs.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/util/makedefs.c b/util/makedefs.c index b1fb28aa0..c3b0ea451 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -355,7 +355,13 @@ do_rumors() Strcat(filename,file_prefix); #endif Sprintf(eos(filename), DATA_TEMPLATE, RUMOR_FILE); - if (!(ofp = fopen(filename, WRTMODE))) { + if (!(ofp = fopen(filename, +#ifdef WIN32 + WRBMODE +#else + WRTMODE +#endif + ))) { perror(filename); exit(EXIT_FAILURE); } @@ -363,7 +369,13 @@ do_rumors() Sprintf(infile, DATA_IN_TEMPLATE, RUMOR_FILE); Strcat(infile, ".tru"); - if (!(ifp = fopen(infile, RDTMODE))) { + if (!(ifp = fopen(infile, +#ifdef WIN32 + RDBMODE +#else + RDTMODE +#endif + ))) { perror(infile); Fclose(ofp); Unlink(filename); /* kill empty output file */ @@ -393,7 +405,13 @@ do_rumors() Sprintf(infile, DATA_IN_TEMPLATE, RUMOR_FILE); Strcat(infile, ".fal"); - if (!(ifp = fopen(infile, RDTMODE))) { + if (!(ifp = fopen(infile, +#ifdef WIN32 + RDBMODE +#else + RDTMODE +#endif + ))) { perror(infile); Fclose(ofp); Unlink(filename); /* kill incomplete output file */ -- 2.40.0