]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(readtokens0): Return true on success rather
authorJim Meyering <jim@meyering.net>
Wed, 24 Mar 2004 14:45:17 +0000 (14:45 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 24 Mar 2004 14:45:17 +0000 (14:45 +0000)
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.

lib/readtokens0.c

index db638a71c42c577697df0039225c447c13aad36a..b46ba8f8544893c10eb93c230ae059646b1eeec0 100644 (file)
@@ -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);
 }