# # patch "transforms.cc" # from [0301854cc96c7c43b527feb0ac5c2914537d9027] # to [d00be4f8e84577baaf68ab0246ae2dfedd9fdda2] # --- transforms.cc +++ transforms.cc @@ -725,11 +725,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 {}. @@ -804,8 +799,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; @@ -833,8 +828,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;