bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

factor no longer stops upon first invalid argument


From: Jim Meyering
Subject: factor no longer stops upon first invalid argument
Date: Sat, 01 Oct 2005 10:05:01 +0200

> However, it would also be nice if factor continued on with its
> remaining arguments, rather than exiting immediately on error:

Thanks for mentioning that.
I've fixed it:

        * src/factor.c (main): Don't stop processing arguments upon
        the first invalid one.  Suggestion from Eric Blake
        * tests/factor/basic: Add a test for this.

Index: src/factor.c
===================================================================
RCS file: /fetish/cu/src/factor.c,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -p -u -r1.75 -r1.76
--- src/factor.c        11 Sep 2005 07:42:43 -0000      1.75
+++ src/factor.c        1 Oct 2005 08:01:25 -0000       1.76
@@ -211,10 +211,10 @@ main (int argc, char **argv)
   else
     {
       int i;
+      ok = true;
       for (i = optind; i < argc; i++)
        if (! print_factors (argv[i]))
-         usage (EXIT_FAILURE);
-      ok = true;
+         ok = false;
     }
 
   exit (ok ? EXIT_SUCCESS : EXIT_FAILURE);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]