diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-07-09 16:37:40 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2005-07-09 16:37:40 +0000 |
commit | 5bf8d77137969334af78d2ccf5b48ecbbb0fc017 (patch) | |
tree | f554aff26edf2281721a746d486d6fa68d6dd0c4 /src/main.c | |
parent | e79e398d70fce001a4d05da2705bb6660acf0a46 (diff) | |
download | cflow-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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; } |