* filetools.C (ReplaceEnvironmentPath): set up patterns just once

using static variables.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7927 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2003-10-16 16:41:32 +00:00
parent 9ed14b41fa
commit f88fb47bc7
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,9 @@
2003-10-16 André Pönitz <poenitz@gmx.net>
* filetools.C (ReplaceEnvironmentPath): set up patterns just once
using static variables.
2003-10-13 João Luis Meloni Assirati <assirati@fma.if.usp.br>
* socktools.[Ch]: New files. Wrapper around socket system calls.

View File

@ -742,14 +742,14 @@ string const ReplaceEnvironmentPath(string const & path)
{
// ${VAR} is defined as
// $\{[A-Za-z_][A-Za-z_0-9]*\}
string const envvar_br = "[$]\\{([A-Za-z_][A-Za-z_0-9]*)\\}";
static string const envvar_br = "[$]\\{([A-Za-z_][A-Za-z_0-9]*)\\}";
// $VAR is defined as:
// $\{[A-Za-z_][A-Za-z_0-9]*\}
string const envvar = "[$]([A-Za-z_][A-Za-z_0-9]*)";
static string const envvar = "[$]([A-Za-z_][A-Za-z_0-9]*)";
boost::regex envvar_br_re("(.*)" + envvar_br + "(.*)");
boost::regex envvar_re("(.*)" + envvar + "(.*)");
static boost::regex envvar_br_re("(.*)" + envvar_br + "(.*)");
static boost::regex envvar_re("(.*)" + envvar + "(.*)");
boost::smatch what;
string result = path;