Files
nethack/doc
PatR 9df552543b fix "Patch for dos mode nethackrc file on linux"
Reported directly to devteam (12 Dec), user had a config file originally
from MSDOS or Windows and used it on a linux system.  That works as-is
except when it contained an invalid option line.  Feedback was
"ad option line: "whatever-the-line-was
because of the carriage return character staying in the option buffer
after linefeed was stripped off from CR+LF line end.

He included a patch which replaced this existing fixup after fgets()
if ((p = index(buf, '\n')) != 0) *p = '\0';
with a loop over the whole string changing either '\n' or '\r' to '\0'.
This uses
if ((p = index(buf, '\n')) != 0) {
if (p > buf && *(p - 1) == '\r') --p;
*p = '\0';
}
instead.  Ordinarily I would have just cloned the original line and then
substituted \r for \n in the copy, but the report mentioned "I couldn't
get index to work with carriage return".  I don't know what he tried to
do or why simple index(buf,'\r') might not work as intended on his
platform, so I went with something that will work even if index()
behaves as strangely as the report suggested.

(We already have a couple of index(string,'\r') calls in use, but I'm
not going to change those unless someone complains about a problem.)
2015-12-24 16:00:50 -08:00
..
2015-03-31 09:50:02 -04:00
2015-02-26 16:35:55 -05:00
2015-05-25 09:21:31 +09:00
2002-01-05 21:05:47 +00:00
2015-05-25 09:21:31 +09:00
2002-01-05 21:05:47 +00:00
2002-01-11 18:02:22 +00:00
2015-05-25 09:21:31 +09:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2002-01-05 21:05:47 +00:00
2003-05-11 13:40:01 +00:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2015-12-10 19:10:26 -05:00
2002-01-05 21:05:47 +00:00
2015-05-25 09:21:31 +09:00
2010-05-01 23:10:22 +00:00
2015-12-08 15:15:00 -08:00
2015-12-08 15:15:00 -08:00