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

@@ -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;