-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 According to Jim Meyering on 1/26/2008 3:55 PM:
| + "groups -- foo" no longer generates a spurious error about the | + nonexistent group "--". Huh? That's been fixed for some time now (Sept 2006): http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=b7c315c | - while I know too well how bad stdio is, I'm tempted to remove the | new tests of each printf return value. I noticed that you check | those while not checking putchar. That's where the combination of xprintf and close-stdout will help - xprintf catches any errors that don't set the ferror bit, and all remaining errors (all putchar errors, and most printf errors) touch the ferror bit and are then caught by close-stdout. In other words, | +int | +main (int argc, char **argv) | +{ ... | + | + atexit (close_stdout); | + because of this call... | + | + if (printf ("%s : ", argv[optind]) < 0) | + { | + write_error (); | + ok = false; | + } You can use xprintf, and the above becomes one line instead of five... | + if (EOF == putchar ('\n')) | + { | + write_error (); | + ok = false; | + } And the above need only be 'putchar ('\n');' instead of five lines, and you don't need the helper function write_error(). | + } | + } | + | + exit (ok ? EXIT_SUCCESS : EXIT_FAILURE); And if you get here, you can use simply 'exit EXIT_SUCCESS;' - the atexit handler will take care of correcting the exit status if there was any write error in the meantime. | - print_user (use_real ? ruid : euid); | + { | + print_user (use_real ? ruid : euid); | + } Why are you making these cosmetic changes, with no other change in the code? GNU Coding Standards recommend eliding the braces for single-line statements (yes, it is a style that not everyone likes, because you then have to remember to add braces if you add a statement, but consistency looks nicer). - -- Don't work too hard, make some time for fun as well! Eric Blake [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (Cygwin) Comment: Public key at home.comcast.net/~ericblake/eblake.gpg Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHm8LL84KuGfSFAYARAhqLAKCIGzZxagwv6uKrQZNd0Vfo1hq7XACfX2kU yz4KQydFFZcObH58+8zVOFc= =yJqQ -----END PGP SIGNATURE----- _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils