Fix a bug detected by the unit tests: to ensure consistent handling of
trailing whitespace, openpam_readword() should *always* push back the last character read (which is a no-op in the EOF case). git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@550 185d5e19-27fe-0310-9dcf-9bff6b9f3609
This commit is contained in:
parent
d7708b3ae5
commit
49a4c1509e
|
@ -118,8 +118,7 @@ openpam_readword(FILE *f, int *lineno, size_t *lenp)
|
|||
errno = EINVAL;
|
||||
return (NULL);
|
||||
}
|
||||
if (ch == '\n')
|
||||
ungetc(ch, f);
|
||||
ungetc(ch, f);
|
||||
if (lenp != NULL)
|
||||
*lenp = len;
|
||||
return (word);
|
||||
|
|
Loading…
Reference in New Issue