]> granicus.if.org Git - nethack/commit
more rumors processing (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 7 May 2006 05:31:27 +0000 (05:31 +0000)
committernethack.rankin <nethack.rankin>
Sun, 7 May 2006 05:31:27 +0000 (05:31 +0000)
commita71d270a21b36d7b4d3b89e714358819314b059d
treec6a6760197ef4f03f5b9c66dcaff2b2c2744f496
parent13944ab03bbfb8d443c9906d149e0f47c540e158
more rumors processing (trunk only)

     This fix should work for both DLB and non-DLB without forcing binary
mode for the latter.  And it should continue to work even if we later
decide to force that mode (which I think we should do...).  Use actual
file positions to calculate the size of the true and false sections,
rather than counting the bytes of each rumor (that counting has been left
in place but it gets overridden now.)  Those two sizes will be bigger on
platforms which use CR+LF line ends and maintain dat/rumors as non-DLB
text file.  But due to the way that nethack uses the sizes, such size
differences don't matter.

     The branch variant shouldn't need any corresponding fix.  It uses
the counting method when the output is binary, where the accumulated
value is accurate, and the check end-of-file shortcut when using text,
which should not be affected by stdio converting CR+LF into \n for text
input and back to CR+LF again for text output.  (The original bug was due
to starting out with the EOF shortcut when input had CR+LF line ends, but
then writing less data due to binary output keeping just LF instead of
putting CR back.)
util/makedefs.c