Kaydet (Commit) 56211a16 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

fdo#72394 Don't endlessly expand $(share_subdir_name) into itself

The introduction of $(share_subdir_name) expanding to "share" in
c6a73009 "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.  ac4e19f9 "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
  791a8b96 because it "Unfortunately does not
  work if BUILDDIR is different from SRCDIR."

Change-Id: If214c179c0068fbaa475c1c9cac804d6a1dbb2dc
üst bc78c61b
...@@ -999,7 +999,8 @@ throw ( RuntimeException ) ...@@ -999,7 +999,8 @@ throw ( RuntimeException )
bool bMatch = true; bool bMatch = true;
if ( pIterFixed->eVariable == PREDEFVAR_LANG || if ( pIterFixed->eVariable == PREDEFVAR_LANG ||
pIterFixed->eVariable == PREDEFVAR_LANGID || 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 // 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! // describe a whole directory and not only a substring of a directory!
......
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