aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2019-01-22 11:05:31 +0200
committerSergey Poznyakoff <gray@gnu.org>2019-01-22 11:05:31 +0200
commit9cc96ff20dac0d7d2c9091937395f85dc4fc8259 (patch)
tree24e849fb1fb12b4b46eff0e220eba9f8a6264616
parent9fdcc7fc76f41b3b36161db28774c53803e93d91 (diff)
downloadcflow-9cc96ff20dac0d7d2c9091937395f85dc4fc8259.tar.gz
cflow-9cc96ff20dac0d7d2c9091937395f85dc4fc8259.tar.bz2
Bugfix
* src/main.c (main): Make sure preprocessor options are collected before parsing source files.
-rw-r--r--src/main.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 301de44..e67b3e0 100644
--- a/src/main.c
+++ b/src/main.c
@@ -783,12 +783,20 @@ main(int argc, char **argv)
783 783
784 if (arglist) { 784 if (arglist) {
785 struct linked_list_entry *p; 785 struct linked_list_entry *p;
786 786 /* First pass: collect options */
787 for (p = arglist->head; p; p = p->next) { 787 for (p = linked_list_head(arglist); p; ) {
788 struct linked_list_entry *next = p->next;
788 char *s = (char*)p->data; 789 char *s = (char*)p->data;
789 if (s[0] == '-') 790 if (s[0] == '-') {
790 pp_option(s); 791 pp_option(s);
791 else if (source(s) == 0) 792 linked_list_unlink(arglist, p);
793 }
794 p = next;
795 }
796 /* Second pass: collect sources */
797 for (p = linked_list_head(arglist); p; p = p->next) {
798 char *s = (char*)p->data;
799 if (source(s) == 0)
792 yyparse(); 800 yyparse();
793 } 801 }
794 } 802 }

Return to:

Send suggestions and report system problems to the System administrator.