diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-12-09 09:38:35 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-12-09 09:55:44 +0100 |
commit | 56211a166ab25d80de84c2cccce22be15a9be051 (patch) | |
tree | f0fcb6ac7b57fa1cf7ff5f7021086568ca2d9845 /framework | |
parent | bc78c61bd29b1eac4ef70bfbcc67b4b49e16ccdd (diff) |
fdo#72394 Don't endlessly expand $(share_subdir_name) into itself
The introduction of $(share_subdir_name) expanding to "share" in
c6a73009747814513ab5a7277c211449c7378870 "Use subfolder names from
<config_folders.h>" shows that
SubstitutePathVariables::impl_reSubstituteVariables is fundamentally flawed in
that it allows reducing variable occurrences even in variable names, so that it
will expand an occurrence of "share" into an endless recursion of
"$(share_subdir_name)" -> "$($(share_subdir_name)_subdir_name)" -> ...
Adding $(share_subdir_name) to the list of variables that can only replace a
complete path segment (delimited by "/"), from which it had erroneously been
missing, "fixes" this problem for now.
But the code is still wrong in at least two respects:
* SubstitutePathVariables::impl_reSubstituteVariables arguably needs to be made
more robust, to never reduce variable occurrences in variable names.
* The compile-time variable LIBO_SHARE_FOLDER should not end up as a runtime
framework path variable, esp. since accidentally re-substituting it for
"share" segments in unrelated URLs like <file:///export/share/for-all> does
not make sense. ac4e19f9085dbd0103c7336a5318aa1e55b3e3e0 "fdo#68552: Don't
(attempt to) do run-time expansion of build-time parameters" had already
attempted a fix for that, but it had to be reverted again with
791a8b96f754798192875da287c84f8cfa4e533e because it "Unfortunately does not
work if BUILDDIR is different from SRCDIR."
Change-Id: If214c179c0068fbaa475c1c9cac804d6a1dbb2dc
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/services/substitutepathvars.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/framework/source/services/substitutepathvars.cxx b/framework/source/services/substitutepathvars.cxx index 41c03242454e..ec781f2b8a06 100644 --- a/framework/source/services/substitutepathvars.cxx +++ b/framework/source/services/substitutepathvars.cxx @@ -999,7 +999,8 @@ throw ( RuntimeException ) bool bMatch = true; if ( pIterFixed->eVariable == PREDEFVAR_LANG || pIterFixed->eVariable == PREDEFVAR_LANGID || - pIterFixed->eVariable == PREDEFVAR_VLANG ) + pIterFixed->eVariable == PREDEFVAR_VLANG || + pIterFixed->eVariable == PREDEFVAR_SHARE_SUBDIR_NAME ) { // Special path variables as they can occur in the middle of a path. Only match if they // describe a whole directory and not only a substring of a directory! |