solenv/bin/modules/installer/pathanalyzer.pm |    4 ++--
 solenv/bin/modules/pre2par/pathanalyzer.pm   |    5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit f007f32958a7c875db6cb2e79c09ab0965477a2a
Author:     Mike Kaganski <[email protected]>
AuthorDate: Wed Nov 17 01:17:17 2021 +0300
Commit:     Mike Kaganski <[email protected]>
CommitDate: Wed Nov 17 06:15:17 2021 +0100

    tdf#145711: filename may be 1-character, and must not contain path separator
    
    Surfaced after 6ea7ca45782a7e1b46e18e994534ec0a7c71951b
    
    Change-Id: I4975f51a7a0ca73eccfd17338abc122254b57113
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125338
    Tested-by: Mike Kaganski <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>

diff --git a/solenv/bin/modules/installer/pathanalyzer.pm 
b/solenv/bin/modules/installer/pathanalyzer.pm
index 7f3f68a4edb2..312042acb1a0 100644
--- a/solenv/bin/modules/installer/pathanalyzer.pm
+++ b/solenv/bin/modules/installer/pathanalyzer.pm
@@ -47,7 +47,7 @@ sub make_absolute_filename_to_relative_filename
 
     if ( $installer::globals::isunix )
     {
-        if ( $$longfilenameref =~ /^.*\/(\S.+\S?)/ )
+        if ( $$longfilenameref =~ /^.*\/(?=\S)([^\/]+)(?<=\S)/ )
         {
             $$longfilenameref = $1;
         }
@@ -56,7 +56,7 @@ sub make_absolute_filename_to_relative_filename
     if ( $installer::globals::iswin )
     {
         # Either '/' or '\'. It would be possible to use 
$installer::globals::separator.
-        if ( $$longfilenameref =~ /^.*[\/\\](\S.+\S?)/ )
+        if ( $$longfilenameref =~ /^.*[\/\\](?=\S)([^\/\\]+)(?<=\S)/ )
         {
             $$longfilenameref = $1;
         }
diff --git a/solenv/bin/modules/pre2par/pathanalyzer.pm 
b/solenv/bin/modules/pre2par/pathanalyzer.pm
index 0aefcd1b43c8..4d2eb31ae073 100644
--- a/solenv/bin/modules/pre2par/pathanalyzer.pm
+++ b/solenv/bin/modules/pre2par/pathanalyzer.pm
@@ -48,7 +48,7 @@ sub make_absolute_filename_to_relative_filename
 
     if ( $pre2par::globals::isunix )
     {
-        if ( $$longfilenameref =~ /^.*\/(\S.+\S?)/ )
+        if ( $$longfilenameref =~ /^.*\/(?=\S)([^\/]+)(?<=\S)/ )
         {
             $$longfilenameref = $1;
         }
@@ -56,7 +56,8 @@ sub make_absolute_filename_to_relative_filename
 
     if ( $pre2par::globals::iswin )
     {
-        if ( $$longfilenameref =~ /^.*\\(\S.+\S?)/ )
+        # Either '/' or '\'.
+        if ( $$longfilenameref =~ /^.*[\/\\](?=\S)([^\/\\]+)(?<=\S)/ )
         {
             $$longfilenameref = $1;
         }

Reply via email to