[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - basic/source

Julien Nabet serval2412 at yahoo.fr
Mon Apr 20 03:28:50 PDT 2015


 basic/source/runtime/methods.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit ec485dc13bd16a3a9c168758cd742fe38e78b482
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sat Apr 18 23:13:51 2015 +0200

    tdf#55502: Shell BASIC function with empty third param hangs
    
    bt:
    2  0x00002aaaab2b5226 in __assert_fail_base (fmt=0x2aaaab3ebce8 "%s%s%s:%u: %s%sAssertion `%s' failed.
    %n",
        assertion=assertion at entry=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())",
        file=file at entry=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=line at entry=500,
        function=function at entry=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:92
    3  0x00002aaaab2b52d2 in __GI___assert_fail (assertion=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())",
        file=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=500,
        function=0x2aaaae2ed740 <rtl::OUString::operator[](int) const::__PRETTY_FUNCTION__> "sal_Unicode rtl::OUString::operator[](sal_Int32) const") at assert.c:101
    4  0x00002aaaae1f44f8 in rtl::OUString::operator[] (this=0x7fffffff36b0, index=13) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:500
    5  0x00002aaaae274036 in SbRtl_Shell (pBasic=0x3531fc0, rPar=..., bWrite=false) at /home/julien/compile-libreoffice/libreoffice/basic/source/runtime/methods.cxx:3613
    Check if third param isn't empty, if not, aCmdLine finishes with a space character
    
    Change-Id: I095b6dc7c7d2d4c826fb47aa1414c558bbc27c04
    Reviewed-on: https://gerrit.libreoffice.org/15380
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 51df75b..545e396 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -3590,8 +3590,12 @@ RTLFUNC(Shell)
         // attach additional parameters - everything must be parsed anyway
         if( nArgCount >= 4 )
         {
-            aCmdLine += " ";
-            aCmdLine += rPar.Get(3)->GetOUString();
+            OUString tmp = rPar.Get(3)->GetOUString().trim();
+            if (!tmp.isEmpty())
+            {
+                aCmdLine += " ";
+                aCmdLine += tmp;
+            }
         }
         else if( aCmdLine.isEmpty() )
         {


More information about the Libreoffice-commits mailing list