]> thyrsus.com Git - comparator.git/commitdiff
argcount gets set now.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 12 Sep 2003 08:30:32 +0000 (08:30 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 12 Sep 2003 08:30:32 +0000 (08:30 +0000)
main.c

diff --git a/main.c b/main.c
index 9df26753298fabf1f28ccf87e7cc8328e9cadbf7..7c1fc4170ecb36cae9d72abb7cd13c7fc55f2b33 100644 (file)
--- a/main.c
+++ b/main.c
@@ -363,7 +363,7 @@ main(int argc, char *argv[])
     extern char        *optarg;        /* set by getopt */
     extern int optind;         /* set by getopt */
 
-    int status, file_only, compile_only;
+    int status, file_only, compile_only, argcount;
     struct scf_t       *scf;
     char *dir, *outfile;
     struct sorthash_t *np;
@@ -416,7 +416,8 @@ main(int argc, char *argv[])
        sort_count = 0;
     }
 
-    if ((argc - optind) == 0)
+    argcount = (argc - optind);
+    if (argcount == 0)
        usage();
 
     report_time(NULL);
@@ -431,7 +432,7 @@ main(int argc, char *argv[])
     }
 
     /* special case if user gave exactly one tree */
-    if (!compile_only && optind == argc - 1)
+    if (!compile_only && argcount == 1)
     {
        write_scf(argv[optind], stdout);
        exit(0);