]> git.lyx.org Git - features.git/commitdiff
use return value of regex_match to check whether a match was found
authorJoost Verburg <joostverburg@users.sourceforge.net>
Thu, 17 Feb 2011 19:39:07 +0000 (19:39 +0000)
committerJoost Verburg <joostverburg@users.sourceforge.net>
Thu, 17 Feb 2011 19:39:07 +0000 (19:39 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37722 a592a061-630c-0410-9148-cb99ea01b6c8

src/support/filetools.cpp

index 9b3fd80c49fe742b16ad76c51ae3494103e5ac4e..65e49765e9ea05e70c89260eb9722edabe5f2661 100644 (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);