From 962dc00065333bb421d895006c37dd3cbd9ec085 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 12 Sep 2011 10:32:55 +0300 Subject: Accept also a soffice.bin renamed to soffice.bin.exe --- sal/rtl/source/bootstrap.cxx | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'sal') diff --git a/sal/rtl/source/bootstrap.cxx b/sal/rtl/source/bootstrap.cxx index 616470c1f7e8..498cebcc2065 100644 --- a/sal/rtl/source/bootstrap.cxx +++ b/sal/rtl/source/bootstrap.cxx @@ -399,15 +399,21 @@ Bootstrap_Impl * BootstrapMap::getBaseIni() { resolvePathnameUrl(&uri); } else { osl_bootstrap_getExecutableFile_Impl(&uri.pData); + // Strip potentially two such extensions, to allow for + // renaming of soffice.bin to soffice.bin.exe so that + // Visual Studio agrees to start it, if you want to + // debug it from the start. static char const BIN_EXT[] = ".bin"; static char const EXE_EXT[] = ".exe"; - if (uri.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM(BIN_EXT))) { - uri = uri.copy( - 0, uri.getLength() - RTL_CONSTASCII_LENGTH(BIN_EXT)); - } else if (uri.endsWithAsciiL( - RTL_CONSTASCII_STRINGPARAM(EXE_EXT))) { - uri = uri.copy( - 0, uri.getLength() - RTL_CONSTASCII_LENGTH(EXE_EXT)); + for (int i = 0; i < 2; i++) { + if (uri.endsWithAsciiL(RTL_CONSTASCII_STRINGPARAM(BIN_EXT))) { + uri = uri.copy( + 0, uri.getLength() - RTL_CONSTASCII_LENGTH(BIN_EXT)); + } else if (uri.endsWithAsciiL( + RTL_CONSTASCII_STRINGPARAM(EXE_EXT))) { + uri = uri.copy( + 0, uri.getLength() - RTL_CONSTASCII_LENGTH(EXE_EXT)); + } } uri += rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(SAL_CONFIGFILE(""))); -- cgit