aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2005-07-09 16:37:40 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2005-07-09 16:37:40 +0000
commit5bf8d77137969334af78d2ccf5b48ecbbb0fc017 (patch)
treef554aff26edf2281721a746d486d6fa68d6dd0c4 /src/main.c
parente79e398d70fce001a4d05da2705bb6660acf0a46 (diff)
downloadcflow-5bf8d77137969334af78d2ccf5b48ecbbb0fc017.tar.gz
cflow-5bf8d77137969334af78d2ccf5b48ecbbb0fc017.tar.bz2
(main): Use input_file_count to decide whether to print "no input files" diagnostics.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index c2d96b7..a806bd5 100644
--- a/src/main.c
+++ b/src/main.c
@@ -643,15 +643,12 @@ main(int argc, char **argv)
excluded_symbols = xstrdup("");
sourcerc(&argc, &argv);
if (argp_parse (&argp, argc, argv, ARGP_IN_ORDER, &index, NULL))
exit (1);
- if (!arglist)
- error(1, 0, _("no input files"));
-
if (print_option == 0)
print_option = PRINT_TREE;
init();
/* See comment to cleanup_processor */
@@ -662,16 +659,21 @@ main(int argc, char **argv)
else if (source(s) == 0)
yyparse();
}
argc -= index;
argv += index;
+
while (argc--) {
if (source(*argv++) == 0)
yyparse();
}
+
+ if (input_file_count == 0)
+ error(1, 0, _("no input files"));
+
cleanup();
output();
return 0;
}

Return to:

Send suggestions and report system problems to the System administrator.