code in parse_conf_file() to trim trailing blanks/cr was missing them

Observed on a text file with crlf endings on Linux, where the
so-called blank lines weren't being ignored as they should
have been, despite there being a line to remove \r from the
end.

A pointer was being pre-decremented before the check for a
matching whitespace character.
This commit is contained in:
nhmall
2019-06-22 00:05:16 -04:00
parent 2fe57af3f3
commit eaa8c278c8
2 changed files with 3 additions and 2 deletions

View File

@@ -79,6 +79,7 @@ for wizard mode 'monpolycontrol', allow usually disallowed type 'chameleon',
add Space, Return, and Escape to '? k' (help for menu control keys)
hero can no longer negotiate a bribe with a demon lord when deaf
wishing for "foo amulet" now yields an "amulet of foo" rather than random one
code in parse_conf_file() to trim trailing blanks/cr was skipping over them
Fixes to Post-3.6.2 Problems that Were Exposed Via git Repository

View File

@@ -3051,9 +3051,9 @@ boolean FDECL((*proc), (char *));
*ep = '\0';
/* trim off spaces at end of line */
while (--ep >= inbuf
while (ep >= inbuf
&& (*ep == ' ' || *ep == '\t' || *ep == '\r'))
*ep = '\0';
*ep-- = '\0';
if (!config_error_nextline(inbuf)) {
rv = FALSE;