# # patch "transforms.cc" # from [61593e946306f8bd5926c02fca2ea683e510d271] # to [ba125aa4b47dbf1e00df2af72ae5d1a40b7b0175] # --- transforms.cc +++ transforms.cc @@ -738,11 +738,6 @@ // - ] directly following an unescaped [ is escaped. string glob_to_regexp(const string & glob) { - struct bad_glob { - bad_glob() : what("Bad glob syntax") {} - string what; - }; - int in_braces = 0; // counter for levels if {} bool in_brackets = false; // flags if we're inside a [], which // has higher precedence than {}. @@ -817,8 +812,8 @@ tmp += '('; break; case '}': - if (in_braces == 0) - throw bad_glob(); + N(in_braces == 0, + F("trying to end a brace expression in a glob when none is started")); tmp += ')'; in_braces--; break; @@ -846,8 +841,10 @@ } } - if (in_braces != 0 || in_brackets) - throw bad_glob(); + N(in_brackets, + F("run-away bracket expression in glob")); + N(in_braces != 0, + F("run-away brace expression in glob")); #ifdef BUILD_UNIT_TESTS cerr << "DEBUG[glob_to_regexp]: output = \"" << tmp << "\"" << endl;