From 37da3c530c075704a18334f3856b392030646dcf Mon Sep 17 00:00:00 2001 From: Purdea Andrei Date: Tue, 19 May 2020 22:34:30 +0300 Subject: [PATCH] Allow +libext+ and -y .f command file options to be given in any order. --- main.cc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/main.cc b/main.cc index 451d43a2d..8461f5f59 100644 --- a/main.cc +++ b/main.cc @@ -598,6 +598,7 @@ bool had_timescale = false; static void read_iconfig_file(const char*ipath) { char buf[8*1024]; + vector> to_build_library_index; FILE*ifile = fopen(ipath, "r"); if (ifile == 0) { @@ -756,10 +757,10 @@ static void read_iconfig_file(const char*ipath) ignore_missing_modules = true; } else if (strcmp(buf, "-y") == 0) { - build_library_index(cp, CASE_SENSITIVE); + to_build_library_index.push_back(make_tuple(strdup(cp), CASE_SENSITIVE)); } else if (strcmp(buf, "-yl") == 0) { - build_library_index(cp, false); + to_build_library_index.push_back(make_tuple(strdup(cp), false)); } else if (strcmp(buf, "-Y") == 0) { library_suff.push_back(strdup(cp)); @@ -798,6 +799,11 @@ static void read_iconfig_file(const char*ipath) } } fclose(ifile); + for (vector>::iterator it = to_build_library_index.begin() ; + it != to_build_library_index.end() ; ++ it ) { + build_library_index(get<0>(*it), get<1>(*it)); + free(get<0>(*it)); + } } /*