diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2015-04-18 23:13:51 +0200 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2015-04-18 23:42:06 +0200 |
commit | 41392516ca0fc099c383c4319923b895ecc16be6 (patch) | |
tree | 4f358721f81159811c9b8a8a524e7c3d01c988b8 /basic | |
parent | d1aae56014a3e8fa2552ce178a2374c31cf5de12 (diff) |
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@entry=0x2aaaae2ecf10 "index >= 0 && static_cast<sal_uInt32>(index) < static_cast<sal_uInt32>(getLength())",
file=file@entry=0x2aaaae2ecec8 "/home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx", line=line@entry=500,
function=function@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
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/runtime/methods.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 17e2c5f0c712..3b84e4bc0a16 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(); + if (!tmp.isEmpty()) + { + aCmdLine += " "; + aCmdLine += tmp; + } } else if( aCmdLine.isEmpty() ) { |