]> Savannah Git Hosting - gnulib.git/commit
yesno: make EOL optional in ENABLE_NLS case also
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 24 Mar 2015 12:15:27 +0000 (12:15 +0000)
committerPádraig Brady <P@draigBrady.com>
Tue, 24 Mar 2015 12:33:12 +0000 (12:33 +0000)
commit386315b3057802aa426b0599db86e8462cbd34e2
tree6718b6664bed89406b82fbc6f6bb4fb52bba38d8
parentd164bf67cc2d471facdd5d3b09f80f3688b3a21b
yesno: make EOL optional in ENABLE_NLS case also

yesno behaves differently in a corner case depending on ENABLE_NLS.
With an input of "y" followed by an EOF the input is considered to
be "no", because the last character is replaced with '\0'.  It was
assumed that there is a newline, which doesn't have to be true.

If ENABLE_NLS is not set, getchar() reads y and accepts it as "yes",
looping through more getchar() calls until reaching newline or EOF.

* lib/yesno.c (yesno): Check for EOL before replacing.
* tests/test-yesno.sh: Add a test case (test along with gettext).
ChangeLog
lib/yesno.c
tests/test-yesno.sh