mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-08-05 08:10:15 +02:00
(readtokens0): Return true on success rather
than on failure. All callers changed. This also happens to fix a portability bug on pre-C99 hosts, where (bool) INTEGER sometimes returns false even when INTEGER is nonzero.
This commit is contained in:
+2
-2
@@ -60,7 +60,7 @@ save_token (struct Tokens *t)
|
||||
/* Read NUL-separated tokens from stream IN into T until EOF or error.
|
||||
The final NUL is optional. Always append a NULL pointer to the
|
||||
resulting list of token pointers, but that pointer isn't counted
|
||||
via t->n_tok. */
|
||||
via t->n_tok. Return true if successful. */
|
||||
bool
|
||||
readtokens0 (FILE *in, struct Tokens *t)
|
||||
{
|
||||
@@ -94,5 +94,5 @@ readtokens0 (FILE *in, struct Tokens *t)
|
||||
|
||||
t->tok = obstack_finish (&t->o_tok);
|
||||
t->tok_len = obstack_finish (&t->o_tok_len);
|
||||
return ferror (in);
|
||||
return ! ferror (in);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user