From 1e190a2af27ca99831f51567c16e6b39bf4317c3 Mon Sep 17 00:00:00 2001 From: Joost Verburg Date: Thu, 17 Feb 2011 19:39:07 +0000 Subject: [PATCH] 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 --- src/support/filetools.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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); -- 2.39.2