From: Joost Verburg Date: Thu, 17 Feb 2011 19:39:07 +0000 (+0000) Subject: use return value of regex_match to check whether a match was found X-Git-Tag: 2.0.0~698 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=1e190a2af27ca99831f51567c16e6b39bf4317c3;p=features.git 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 --- diff --git a/src/support/filetools.cpp b/src/support/filetools.cpp index 9b3fd80c49..65e49765e9 100644 --- a/src/support/filetools.cpp +++ b/src/support/filetools.cpp @@ -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);