From 4b8927af757b2f79a0077b77365a6f4baf80a92a Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Mon, 29 Sep 2008 15:51:45 -0400 Subject: [PATCH] Expand environment variables in -f input files. --- Changes | 2 + src/V3Options.cpp | 70 +++++++++++++++++++++++------------ src/V3Options.h | 1 + test_regress/t/t_flag_f.vc | 12 +----- test_regress/t/t_flag_f__2.vc | 10 +++++ 5 files changed, 62 insertions(+), 33 deletions(-) create mode 100644 test_regress/t/t_flag_f__2.vc diff --git a/Changes b/Changes index d22ce1aca..d0c593956 100644 --- a/Changes +++ b/Changes @@ -8,6 +8,8 @@ indicates the contributor was also the author of the fix; Thanks! *** Suppress width warnings between constant strings and wider vectors. [Rodney Sinclair] +**** Expand environment variables in -f input files. [Lawrence Butcher] + **** Report error if port declaration is missing; bug32. [Guy-Armand Kamendje] * Verilator 3.671 2008/09/19 diff --git a/src/V3Options.cpp b/src/V3Options.cpp index 51bfea67a..1f3f4f8bf 100644 --- a/src/V3Options.cpp +++ b/src/V3Options.cpp @@ -132,7 +132,7 @@ string V3Options::allArgsString() { V3LangCode::V3LangCode (const char* textp) { // Return code for given string, or ERROR, which is a bad code - for (int codei=V3LangCode::ERROR; codei args; string::size_type startpos = 0; while (startpos < whole_file.length()) { - while (isspace(whole_file[startpos])) startpos++; + while (isspace(whole_file[startpos])) ++startpos; string::size_type endpos = startpos; - while (endpos < whole_file.length() && !isspace(whole_file[endpos])) endpos++; + while (endpos < whole_file.length() && !isspace(whole_file[endpos])) ++endpos; if (startpos != endpos) { string arg (whole_file, startpos, endpos-startpos); args.reserve(args.size()+1); @@ -810,7 +834,7 @@ void V3Options::parseOptsFile(FileLine* fl, const string& filename) { // Convert to argv style arg list and parse them char* argv [args.size()+1]; - for (unsigned i=0; i