use return value of regex_match to check whether a match was found

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37722 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Joost Verburg 2011-02-17 19:39:07 +00:00
parent 6ca9f04412
commit 1e190a2af2

View File

@ -549,12 +549,9 @@ string const replaceEnvironmentPath(string const & path)
string result = path;
while (1) {
smatch what;
regex_match(result, what, envvar_br_re);
if (!what[0].matched) {
regex_match(result, what, envvar_re);
if (!what[0].matched) {
if (!regex_match(result, what, envvar_br_re)) {
if (!regex_match(result, what, envvar_re))
break;
}
}
string env_var = getEnv(what.str(2));
result = what.str(1) + env_var + what.str(3);