diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2011-09-12 10:32:55 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2011-09-12 10:33:15 +0300 |
commit | 962dc00065333bb421d895006c37dd3cbd9ec085 (patch) | |
tree | 4350abe5d1972f1470149e5234480dce694e822d /sal | |
parent | 40816125618dabdff371bb5e39b4ecea36f7a8bd (diff) |
Accept also a soffice.bin renamed to soffice.bin.exe
Diffstat (limited to 'sal')
-rw-r--r-- | sal/rtl/source/bootstrap.cxx | 20 |
1 files changed, 13 insertions, 7 deletions
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(""))); |