]> granicus.if.org Git - nethack/commitdiff
work around win32 rumor issues (#H80)
authornethack.allison <nethack.allison>
Tue, 2 May 2006 22:10:54 +0000 (22:10 +0000)
committernethack.allison <nethack.allison>
Tue, 2 May 2006 22:10:54 +0000 (22:10 +0000)
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

index b1fb28aa05ca1792e197cdac9961b348885fb2cb..c3b0ea451c4b0d7d7372a26ea3ac0b160bb3321a 100644 (file)
@@ -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 */