sal/rtl/bootstrap.cxx |    4 ----
 1 file changed, 4 deletions(-)

New commits:
commit 64c0efa33f004cc942f12d4461f8e07fd4c2ff85
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Wed Jan 7 10:15:04 2026 +0100
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Wed Jan 7 17:19:19 2026 +0100

    Don't consider semantics for three-segment bootstrap var refs erroneous
    
    I had added that comment back in 4a415c4c5af68a8b492e845dd7d5b6d0948f0b54
    "INTEGRATION: CWS sb83 (1.39.26); FILE MERGED", but on second thought, it 
might
    be better to consider a three-segment botostrap variable reference of the 
form
    ${file:section:key} (which are hardly used anywhere, if at all, anyway) to 
do
    something special:  It reads the "'osl' profile" <file> and uses the value 
(if
    any) for the given <section> and <key>, without expanding it any further, by
    design.
    
    That's in line with what the documentation in OOo's CVS
    udk/www/common/man/concept/uno_default_bootstrapping.html said,
    
    >                                 <li>
    >                                 Allow indirect expansion of variables 
through 'osl' profiles:
    >                                 <br/>
    >                                 
KEYVALUE=${sversionrc:versions:StarOffice6.0}
    >                                 <br/>
    >                                 The first part of the indirection is the 
file to use for
    >                                 expansion, the second part is
    >                                 the section and the third part is the 
key. After expansion the
    >                                 variable KEYVALUE has
    >                                 the value of the matching key of the 
sversionrc.
    >                                 </li>
    
    and what the original code in OOo's CVS porting/sal/rtl/source/macro.cxx
    ArgParserState::expandTerm did,
    
    >                 // do we have a section?
    >                 OUString value;
    >                 if (section.getLength())
    >                 {
    >                         // expand from profile
    >                         oslProfile hProfile;
    [...]
    >                 }
    >                 else
    >                 {
    >                         // expand from ini:
    
    And it's also in line with the documentation in include/rtl/bootstrap.h 
stating
    
    >    An ini-file is only allowed to have one section, which must be named
    >    `[Bootstrap]` with the square brackets.
    >    The section may be omitted.
    
    Which implies that the <file> in a ${file:section:key} reference is not 
actually
    a bootstrap ini-file (but rather an "'osl' profile"), because those 
bootstrap
    ini-files should not have multiple sections anyway.
    
    Change-Id: Iaf6e97a61fe5a4a330451794a62067b4add20a05
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196674
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/sal/rtl/bootstrap.cxx b/sal/rtl/bootstrap.cxx
index 2ca189923108..e926ad9b8365 100644
--- a/sal/rtl/bootstrap.cxx
+++ b/sal/rtl/bootstrap.cxx
@@ -982,10 +982,6 @@ OUString expandMacros(
                 }
                 else
                 {
-                    // Going through osl::Profile, this code erroneously
-                    // does not recursively expand macros in the resulting
-                    // replacement text (and if it did, it would fail to
-                    // detect cycles that pass through here):
                     buf.append(
                         OStringToOUString(
                             osl::Profile(seg[0]).readString(
  • core.git: sal/rtl Stephan Bergmann (via logerrit)

Reply via email to