From e22e7b6ce0b50f2032b897d0b0d07edbb9ba07c4 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 12 Sep 2003 08:30:32 +0000 Subject: [PATCH] argcount gets set now. --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 9df2675..7c1fc41 100644 --- 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); -- 2.43.0