summaryrefslogtreecommitdiff
path: root/sal/osl
AgeCommit message (Collapse)Author
2019-07-19coverity concurrency annotation attemptNoel Grandin
Let us see what happens if we annotate our mutex code, https://scan.coverity.com/models Change-Id: I7baf44d1a252f19b4ae47f3a6b318f7ccd9629d7 Reviewed-on: https://gerrit.libreoffice.org/75851 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-07-18cid#1448288 Unchecked return value from libraryCaolán McNamara
Change-Id: Id1b8044126e65e67b2496cf7a4eb86b54ba6c1df Reviewed-on: https://gerrit.libreoffice.org/75872 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-07-09Optimize osl_getSystemTime on WindowsMike Kaganski
Make OffTime static const; don't cast from FILETIME to __int64 (see https://docs.microsoft.com/en-us/windows/win32/api/minwinbase/ns-minwinbase-filetime for explanation: "it can cause alignment faults on 64-bit Windows"). Instead, cast in opposite direction: from 8-byte-aligned 64-bit integer to FILETIME. Change-Id: Iba61cc0198f8f25ef471d87e661c8801724b913d Reviewed-on: https://gerrit.libreoffice.org/75256 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-06-03tdf#67538 XTypeDetection::queryTypeByDescriptor poor performance, part4Noel Grandin
WPXSvInputStreamImpl was hammering on getFilePos pretty hard, and getFilePos uses a mutex, which is slow when it is called from every single read. So switch to using std::atomic to access position. This is specifically fixing the performance of queryTypeByDescriptor when called from a basic macro on a local test file. This takes my test macro from 8s to 4s. Change-Id: Iab707a374359e2ee0e92425b2d9a903d67cb53d4 Reviewed-on: https://gerrit.libreoffice.org/73377 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-05-16Use hand-crafted passwd entry for iOS Simulator as getpwuid_r() does not workTor Lillqvist
getpwuid_r() returns nullptr. Oddly enough, it does work on actual iOS, though. So use hand-crafted values that match behaviour on actual iOS. Change-Id: Idcc95d330a93495938520229e039f340876c3653
2019-05-10an is used before a vowel soundCaolán McNamara
not before vowels with a consonant sound so its a url not an url Change-Id: Ic27ff3bee67469284d460c31ced6f63cb3633db2 Reviewed-on: https://gerrit.libreoffice.org/72062 Reviewed-by: Jens Carl <j.carl43@gmx.de> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-04-28tdf#120703 PVS: dereference before nullptr checkMike Kaganski
V595 The 'ustrFile' pointer was utilized before it was verified against nullptr. Check lines: 83, 107. Change-Id: I874983508fb805b1f0a55b3a5b6d4d78ae1babdb Reviewed-on: https://gerrit.libreoffice.org/71472 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-18Don't set locale env vars on macOSStephan Bergmann
macosx_getLocale (via getProcessLocale, both sal/osl/unx/osxlocale.cxx) obtains from the system a locale string like "en-DE". (Whether that is even a sane and recommended way to obtain the system locale on macOS I don't know; but lets leave it at that for now.) However, setting a locale env var (LANG, LC_ALL) to such a value causes a constructor call std::locale("") to throw a std::runtime_error "collate_byname<char>::collate_byname failed to construct for ", at least on macOS 10.14.4. And libdivvun (which might be bundled with a LO extension) is known to be hit by that, see <https://github.com/divvun/libdivvun/issues/28> "locale("") gives 'collate_byname<char>::collate_byname failed to construct for ' on LO on mac". The code setting LC_ALL/LC_CTYPE/LANG was there ever since 8737d1831b48acd8a4793c4728ad8563f77b5bf8 "INTEGRATION: CWS geordi2q14: #111934#: merge CWS ooo111fix2", but for unclear reasons. Lets assume that it had no purpose (any longer). Change-Id: I0b519ad567a713d61f662aa984791db1a91c708c Reviewed-on: https://gerrit.libreoffice.org/70918 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-04-17tdf#124776: don't use SearchPathW to get full path of executableMike Kaganski
... use GetModuleFileNameW() for that. We call SetDllDirectoryW and SetSearchPathMode to improve security of the process, and exclude some paths (including current directory) from search when using API that looks for binaries whose names are not fully qualified. So the sequence is this: 1. Program is started using relative executable path like "instdir\program\soffice"; 2. sal_detail_initialize is called, which calls the two mentioned hardening functions; 3. sal_detail_initialize calls osl_setCommandArgs, which in turn calls osl_createCommandArgs_Impl; 4. The latter uses SearchPathW with empty path and first program arg "instdir\program\soffice" to find fully qualified program path. That now naturally fails, because current path is not searched. But to find the process name, we need no search: we can simply use GetModuleFileNameW() with NULL passed as module handle. Let's use that. Note that we can't use _wpgmptr/_get_wpgmptr, because we don't use wide entry point like wmain. Change-Id: I7a0013a0505f7bdd38164b09b045bfade9686664 Reviewed-on: https://gerrit.libreoffice.org/70844 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-15improve loplugin simplifyconstructNoel Grandin
to find stuff like OUString s = OUString("xxx") Change-Id: Ie7ed074c1ae012734c67a2a89c564c1900a4ab04 Reviewed-on: https://gerrit.libreoffice.org/70697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-13loplugin:sequentialassign in salNoel Grandin
Change-Id: I7bd1511a6acc105ab5b42c698c7578cfb9ce06b4 Reviewed-on: https://gerrit.libreoffice.org/70708 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-13use more std::make_uniqueNoel Grandin
Change-Id: I7d85cbc9105c5e0c4a8d9a69c4ac9d6dfc07eabd Reviewed-on: https://gerrit.libreoffice.org/70663 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-05Replace legacy dynamically-loaded functions with statically linked onesMike Kaganski
We don't need the dynamic load complexity for these now with baseline Windows version being Windows 7 SP1. Stuff used only for compatibility with older versions was dumped. Change-Id: I810f271796cfd875cfa18a3081c9ad444fe57b3e Reviewed-on: https://gerrit.libreoffice.org/70321 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-04-03In LibreOffice core commit d4d3766, several variables were changedGreg Veldman
to be declared as const. However, on platforms not excluded by NO_PTHREAD_PRIORITY, osl_thread_priority_init_Impl() then tries later to assign values to these. This leads to compiler errors on platforms so affected, including FreeBSD. Revert as necessary on affected platforms, also using NO_PTHREAD_PRIORITY to match the code in osl_thread_priority_init_Impl(). Change-Id: I0e968231e7c1be9771844222a7bab1f0fcb51a0e Reviewed-on: https://gerrit.libreoffice.org/69603 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-04-01tdf#120703 PVS: Silence V522 warningsMike Kaganski
V522 There might be dereferencing of a potential null pointer. Change-Id: Ie617b41a8f8d334022cf5313b242a236baedba48 Reviewed-on: https://gerrit.libreoffice.org/70017 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-31tdf#120703 PVS: Silence V575 warningsMike Kaganski
V575 The potential null pointer is passed into 'foo' function Add asserts to those cases that are related to OOM cases. There's nothing to be done if the assertions fail anyway. Change-Id: I92ac95d44f512aa1948b1552b0e1f6da695a9f92 Reviewed-on: https://gerrit.libreoffice.org/70008 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
2019-03-27Remove unused macros that caused compiler warnings and simplifyTor Lillqvist
Change-Id: Ica146899a5557732babf4e07b20b9e3d32426c6e Reviewed-on: https://gerrit.libreoffice.org/69824 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <tml@collabora.com>
2019-03-27loplugin:typedefparam (clang-cl)Stephan Bergmann
Change-Id: I07604028845c49cc084927e21db7f21c5d053bab Reviewed-on: https://gerrit.libreoffice.org/69796 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-27Replace gethostbyname_r with getaddrinfoArkadiy Illarionov
The gethostbyname*() functions are obsolete. Change-Id: I14a55eba3f111a3280f23955ffd86843079c7e75 Reviewed-on: https://gerrit.libreoffice.org/69337 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-19hang in crashtesting, would be nice to know what failed to exec hereCaolán McNamara
#0 0x00007f8dc781e4dc in __lll_lock_wait () from /lib64/libpthread.so.0 #1 0x00007f8dc781a1b8 in _L_lock_820 () from /lib64/libpthread.so.0 #2 0x00007f8dc781a088 in pthread_mutex_lock () from /lib64/libpthread.so.0 #3 0x00007f8dc81d57d1 in lookupThreadId (hThread=140246229497600) at sal/osl/unx/thread.cxx:585 #4 0x00007f8dc81d5aa4 in osl_getThreadIdentifier (Thread=0x0) at sal/osl/unx/thread.cxx:701 #5 0x00007f8dc8173fa0 in osl::Thread::getCurrentIdentifier () at include/osl/thread.hxx:138 #6 0x00007f8dc81736ba in sal_detail_log (level=SAL_DETAIL_LOG_LEVEL_WARN, area=0x7f8dc81f2e53 "sal.osl", where=0x7f8dc81f3130 "sal/osl/unx/process.cxx:238: ", message=0x5bd5b90 "Failed to exec: ENOENT", backtraceDepth=0) at sal/osl/all/log.cxx:279 #7 0x00007f8dc816d166 in sal::detail::log (level=SAL_DETAIL_LOG_LEVEL_WARN, area=0x7f8dc81f2e53 "sal.osl", where=0x7f8dc81f3130 "sal/osl/unx/process.cxx:238: ", stream=..., backtraceDepth=0) at include/sal/log.hxx:50 #8 0x00007f8dc81c1ddc in ChildStatusProc (pData=0x7f8d9e302a90) at sal/osl/unx/process.cxx:238 #9 0x00007f8dc81d49a6 in osl_thread_start_Impl (pData=0x6757780) at sal/osl/unx/thread.cxx:235 #10 0x00007f8dc7817f6b in start_thread () from /lib64/libpthread.so.0 #11 0x00007f8dc7b227ed in clone () from /lib64/libc.so.6 Change-Id: I611cf907f89c7a1d8cdc3a9c42f449e8daaa2614 Reviewed-on: https://gerrit.libreoffice.org/69363 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
2019-03-18tdf#96038 Make shell function work with paths containing spacesRoland Baudin
Explanation of the patch: in the Windows version of LibreOffice, when calling the basic Shell(...) function (located in basic/source/runtime/methods.cxx), a function is_batch_file() is called in turn, to check if the program file path to execute is a batch or an executable. The function is_batch_file() is located in sal/osl/w32/procimpl.cxx and simply checks if the file extension is equal to bat (or cmd or btm). This works as expected, except when the file path contains space characters. In that case, the file path is *quoted* before the call to is_batch_file() and for a batch file the file extension becomes bat" (note the quote) instead of bat, and thus the call to is_batch_file() wrongly returns false in that case. In this patch, the issue is fixed by changing the function get_file_extension() to make it return the correct extension (i.e. without the '"' character) when the file name is quoted. Change-Id: Ib6e74da87b23d64db925c17f8a26617f1a86a83d Reviewed-on: https://gerrit.libreoffice.org/69230 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-03-08new loplugin constvarsNoel Grandin
detect static variables that can be made const. Thanks to mike kaganski for suggesting this. Here I introduce a new plugin feature - using markers in nearby comments to disable the plugin for specific vars. Some of this stuff was old debugging code. I removed the stuff that was older than 5 years. Change-Id: I6ec7742a7fdadf28fd128b592fcdf6da8257585c Reviewed-on: https://gerrit.libreoffice.org/68807 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-06loplugin:unnecessaryparen improve member expressionNoel Grandin
Change-Id: I304621018cb1e2a47e478e86df4229bcf2176741 Reviewed-on: https://gerrit.libreoffice.org/68757 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-05re-land "new loplugin typedefparam""Noel Grandin
This reverts commit c9bb48386bad7d2a40e6958883328145ae439cad, and adds a bunch more fixes. Change-Id: Ib584d302a73125528eba85fa1e722cb6fc41538a Reviewed-on: https://gerrit.libreoffice.org/68680 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-04Revert "new loplugin typedefparam"Noel Grandin
This reverts commit 9865440d217d975206a3f91612f0666312bc8fd8. This is not ready to land yet, seems like the latest update of the logic reveals a bunch more places I need to fix before it can land.
2019-03-04new loplugin typedefparamNoel Grandin
verify that parameters use the exact same typedef-names (if any) in definition and declaration Change-Id: I55d2817f599b0253904dce2d35a1a93967e15a77 Reviewed-on: https://gerrit.libreoffice.org/68439 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-03-01make SAL_DEBUG add newline in Windows debug console tooLuboš Luňák
Change-Id: I7485ab11e4bb60420153ac53784057e5cc905c39 Reviewed-on: https://gerrit.libreoffice.org/68499 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
2019-02-26loplugin:indentation (clang-cl)Stephan Bergmann
Change-Id: I94689e4eed290b4505d2caba2d9802ef7fb6cffd Reviewed-on: https://gerrit.libreoffice.org/68378 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-26loplugin:simplifybool (clang-cl)Stephan Bergmann
Change-Id: Ia10e08c04fb6dfc18597fcfba3fe52cf0ba7184c Reviewed-on: https://gerrit.libreoffice.org/68377 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-22-Werror,-Wsign-compare (clang-cl)Stephan Bergmann
Change-Id: I7e9a709fe36b38ee8842dd34ab06f9608f498ec8 Reviewed-on: https://gerrit.libreoffice.org/68197 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-22error: expected parentheses around type name in sizeof expression (clang-cl)Stephan Bergmann
Change-Id: Ia4814242cc20fbfe35eaff95ddd64dd94e6d69af Reviewed-on: https://gerrit.libreoffice.org/68196 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-21loplugin:indentation (macOS)Stephan Bergmann
* Some .m/.mm files that still contained tabs instead of spaces have been cleaned up with Emacs' untabify (and apple_remote/source/HIDRemoteControlDevice.m needed further manual adaptions): apple_remote/source/GlobalKeyboardDevice.m apple_remote/source/HIDRemoteControlDevice.m apple_remote/source/KeyspanFrontRowControl.m apple_remote/source/RemoteControl.m vcl/osx/a11yrolehelper.mm * Some of the changes predate 0626e66d761de18f62e4d00d427903032da9d517 "Avoid loplugin:indentation after preproc conditional inclusion lines" and would likely have no longer been flagged since. Change-Id: Ibf5faffa743c7f79b36109d9879eb79d63c8c40f Reviewed-on: https://gerrit.libreoffice.org/68090 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-09loplugin:indentation in registry..saxNoel Grandin
Change-Id: I4b877751818febaec8e64018335dca691a476a43 Reviewed-on: https://gerrit.libreoffice.org/67561 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2019-02-07Make osl_getLocalHostname thread-safeStephan Bergmann
Change-Id: I82b8c49fcbbec161bf968573e28992fa5737b45b Reviewed-on: https://gerrit.libreoffice.org/67508 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-07Make osl_getLocalHostname thread-safeStephan Bergmann
Change-Id: I19b0cc48b18ddda5bd09c88f03565e9b73ed776a Reviewed-on: https://gerrit.libreoffice.org/67495 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-06tdf#107461: For Unix-like OS, support file://<hostname>/... URLsStephan Bergmann
...where <hostname> matches whatever osl_getLocalHostname reports. (And, for simplicity, don't support variations where e.g. one of the two FQDNs has an optional final dot while the other has not.) (It is not clear to me whether a similar change should also be done for the Windows-specific code in sal/osl/w32/file_url.cxx. On Windows, file URLs with a host component are generally interpreted as UNC pathnames, and in some local test on a Windows 8 machine whose hostname is reported as "win8", passing a URL like <file://win8/Users/me/Documents/...> (i.e., without a C: drive letter) to LO already worked to access files on the default drive C: at least.) Change-Id: I7a69b6d4ca76a71223def7b90d7c3b8b731ee86d Reviewed-on: https://gerrit.libreoffice.org/67437 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-02-05Improve osl_getLocalHostname on WindowsStephan Bergmann
...returning a non-dotted result obtained from gethostname in case trying via osl_createHostAddrByName doesn't work either. The code had been like this ever since its introduction with 74f3ed51f1e3fa7a199210fd6ffc69d78a535c08 "made socket and pipe refcounted, added blocking read write methods, added direct access methods for struct sockaddr", but there appears to be no good reason not to return the non-dotted gethostname value as a fallback (and it may just have been an oversight not to do so; and on e.g. Linux we simply return whatever a successful call to gethostname provides, be it dotted or not, ever since at least ebd00f5c46707e0dfcdd074f581ae86c0576e69b "socket.cxx -> socket.c", too). (Calls to osl_getLocalHostname are few across the code base, so this change in behavior is unlikely to cause any regressions. I came across this wile looking into <https://bugs.documentfoundation.org/show_bug.cgi?id=107461> "Does not support 'file://' scheme with actual hostname", but this change is unrelated to any potential fix for that issue. It just felt right to get this fixed in passing.) Change-Id: I78e59140579b9d37ee435a8f121e58544d2235eb Reviewed-on: https://gerrit.libreoffice.org/67390 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-31loplugin:unnecessaryparen (clang-cl)Stephan Bergmann
Change-Id: I0cd14e0ace9c9d2fcd880477b0485295e3010b71 Reviewed-on: https://gerrit.libreoffice.org/67138 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-30loplugin:redundantinline (clang-cl)Stephan Bergmann
Change-Id: Ib6320ddc049e93cca4c5931ad28d1873d34bd8b4 Reviewed-on: https://gerrit.libreoffice.org/67137 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-23rhbz#1667364 Open doc as R/O for which open(...,O_RDWR) returns EOPNOTSUPPStephan Bergmann
Map that EOPNOTSUPP to osl_File_E_NOSYS (and intercept it in StillReadWriteInteraction, as used by MediaDescriptor::impl_openStreamWithURL in unotools/source/misc/mediadescriptor.cxx, which will retry opening it read-only then), instead of to osl_File_E_invalidError (which lead to the "General input/output error" box). Instead of "silently" opening the doc as read-only, this still pops up a box claiming that the doc is locked by somebody else, asking whether to open it read-only or to open a copy. That's probably because of the rDescriptor.erase( utl::MediaDescriptor::PROP_READONLY() ); in TypeDetection::impl_openStream (filter/source/config/cache/typedetection.cxx) where the comment already hints at the confusion among the different read-only and locking concepts. Changing that looks like it would easily cause regressions, so is left for a follow-up commit. (And ultimately LO wouldn't need to treat the doc as read-only at all; it would just need to not attempt to open it O_RDWR upfront, and save it via copy+rename, like other apps appear to commonly do.) Change-Id: I56e18f1864084ba222acaf0e38a604082edaf4c6 Reviewed-on: https://gerrit.libreoffice.org/66805 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Avoid unnecessary string copying in osl_getDottedInetAddrOfSocketAddrStephan Bergmann
Change-Id: I57aea80f0489c4176990d7233a4c218e5199a993 Reviewed-on: https://gerrit.libreoffice.org/66467 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Use OString for memory management of osl_psz_createPipeStephan Bergmann
...and make sure that the generated name is actually short enough to be stored in a sockaddr_un::sun_path. (oslPipeImpl::m_Name is only used to store such a name, to be used in osl_closePipe, so just make it of the same size to guarantee that copying between the two with strcpy will always work.) Change-Id: I6d1d0c5518e6d09eff129d682a1a334d12201e90 Reviewed-on: https://gerrit.libreoffice.org/66469 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Avoid unnecessary string copying in osl_getUserNameStephan Bergmann
Change-Id: I00a4b6aef307621b1607abbe75b3a64e6f8fb40a Reviewed-on: https://gerrit.libreoffice.org/66464 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Use OString for memory management of getBootstrapSocketPathStephan Bergmann
Change-Id: If1187cbb428d329fa10070662282d7fc3aeaf9de Reviewed-on: https://gerrit.libreoffice.org/66441 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16New loplugin:emptyStephan Bergmann
Change-Id: I8729db064573ac21dfe6b203c5ae244d79ecc4fe Reviewed-on: https://gerrit.libreoffice.org/66430 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Use OString for memory management of osl_psz_getConfigDirStephan Bergmann
Change-Id: I034a0ee66266d33e294271fdcf1ab13341e51b2e Reviewed-on: https://gerrit.libreoffice.org/66426 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-16Use OString for memory management of osl_psz_getHomeDirStephan Bergmann
Change-Id: I9062c953d5fbebf323d01b05902f6cd0d0239d03 Reviewed-on: https://gerrit.libreoffice.org/66425 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-15simplify duplicate codeStephan Bergmann
Change-Id: Id3b2c0de16d2b6f7fd12dcdf6fc7354541ee0b61 Reviewed-on: https://gerrit.libreoffice.org/66396 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-15Use C++ OString/OUString classes hereStephan Bergmann
...instead of underlying C structs Change-Id: I25f1de9a902e5d8ed459c9b1bfc8a8c855eefb2d Reviewed-on: https://gerrit.libreoffice.org/66394 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
2019-01-15Avoid unnecessary string copying in osl_getUserNameStephan Bergmann
...while being careful to keep initializing *ustrName to an empty string when returning false (whether or not client code relies on that detail) Change-Id: Idd079a0b5a31b844287048dce57bf0fafcc32d1d Reviewed-on: https://gerrit.libreoffice.org/66388 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>