Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  IPC::Locker
  Parallel::Forker
  Voneline
General Info
  Papers

allow-double-quotes-in-option-file.patch

Yves Mathieu, 10/02/2019 02:49 PM

Download (1.46 KB)

View differences:

src/V3Options.cpp
1164 1164
    fl = new FileLine(filename);
1165 1165

  
1166 1166
    // Split into argument list and process
1167
    // Note we don't respect quotes.  It seems most simulators dont.
1168
    // Woez those that expect it; we'll at least complain.
1169
    if (whole_file.find('\"') != string::npos) {
1170
        fl->v3error("Double quotes in -f files cause unspecified behavior.");
1171
    }
1172

  
1173 1167
    // Strip off arguments and parse into words
1174 1168
    std::vector<string> args;
1175 1169
    string::size_type startpos = 0;
1176 1170
    while (startpos < whole_file.length()) {
1177 1171
        while (isspace(whole_file[startpos])) ++startpos;
1178 1172
        string::size_type endpos = startpos;
1179
        while (endpos < whole_file.length() && !isspace(whole_file[endpos])) ++endpos;
1173
        bool end_of_word=false ;
1174
        bool in_quoted_string=whole_file[startpos]=='"' ;
1175
        while(!end_of_word && endpos < whole_file.length()) {
1176
            ++endpos ;
1177
            if(isspace(whole_file[endpos])) {
1178
                if(!in_quoted_string) end_of_word=true ;
1179
            } else  {
1180
                if(whole_file[endpos]=='"') in_quoted_string = !in_quoted_string ;
1181
            }
1182
        }
1180 1183
        if (startpos != endpos) {
1181 1184
            string arg (whole_file, startpos, endpos-startpos);
1182 1185
            args.reserve(args.size()+1);