Kaydet (Commit) 84ecea96 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

fdo#42961 Don't let env vars interfere with internal bootstrap vars

üst 32dc82b9
...@@ -53,6 +53,7 @@ ...@@ -53,6 +53,7 @@
#include "rtl/oustringostreaminserter.hxx" #include "rtl/oustringostreaminserter.hxx"
#include "rtl/ref.hxx" #include "rtl/ref.hxx"
#include "rtl/string.h" #include "rtl/string.h"
#include "rtl/ustrbuf.hxx"
#include "rtl/ustring.h" #include "rtl/ustring.h"
#include "rtl/ustring.hxx" #include "rtl/ustring.hxx"
#include "rtl/instance.hxx" #include "rtl/instance.hxx"
...@@ -827,17 +828,38 @@ void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) { ...@@ -827,17 +828,38 @@ void Components::parseXcsXcuLayer(int layer, rtl::OUString const & url) {
void Components::parseXcsXcuIniLayer( void Components::parseXcsXcuIniLayer(
int layer, rtl::OUString const & url, bool recordAdditions) int layer, rtl::OUString const & url, bool recordAdditions)
{ {
//TODO: rtl::Bootstrap::getFrom "first trie[s] to retrieve the value via the // Check if ini file exists (otherwise .override would still read global
// global function" // SCHEMA/DATA variables, which could interfere with unrelated environment
// variables):
rtl::Bootstrap ini(url); rtl::Bootstrap ini(url);
rtl::OUString urls; if (ini.getHandle() != 0)
if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SCHEMA")), urls))
{ {
parseFileList(layer, &parseXcsFile, urls, ini, false); rtl::OUStringBuffer prefix("${.override:");
} for (sal_Int32 i = 0; i != url.getLength(); ++i) {
if (ini.getFrom(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DATA")), urls)) sal_Unicode c = url[i];
{ switch (c) {
parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions); case '$':
case ':':
case '\\':
prefix.append('\\');
// fall through
default:
prefix.append(c);
}
}
prefix.append(':');
rtl::OUString urls(prefix.toString() + rtl::OUString("SCHEMA}"));
rtl::Bootstrap::expandMacros(urls);
if (!urls.isEmpty())
{
parseFileList(layer, &parseXcsFile, urls, ini, false);
}
urls = prefix.makeStringAndClear() + rtl::OUString("DATA}");
rtl::Bootstrap::expandMacros(urls);
if (!urls.isEmpty())
{
parseFileList(layer + 1, &parseXcuFile, urls, ini, recordAdditions);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment