unoidl/source/sourcetreeprovider.cxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
New commits: commit fa8e80f06558db9e74dc318f40fb599f7bae300b Author: Tor Lillqvist <[email protected]> AuthorDate: Sun Jan 11 22:18:35 2026 +0200 Commit: Tor Lillqvist <[email protected]> CommitDate: Mon Jan 12 13:16:15 2026 +0100 Be prepared for a case-insensitive file system on Linux, too, not just macOS Can easily happen at least on WSL. Also avoid warnings about the deprecated readdir_r(). In current POSIX, readdir() is required to be thread-safe. (It might well have been for a long time in those POSIXish platforms we care for, I don't know.) Change-Id: I2b89b7aa170f661365580979d151c1b0557955fd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197053 Tested-by: Jenkins Reviewed-by: Tor Lillqvist <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/unoidl/source/sourcetreeprovider.cxx b/unoidl/source/sourcetreeprovider.cxx index bc7be26d7096..e212ed1b734d 100644 --- a/unoidl/source/sourcetreeprovider.cxx +++ b/unoidl/source/sourcetreeprovider.cxx @@ -25,7 +25,7 @@ #include "sourceprovider-scanner.hxx" #include "sourcetreeprovider.hxx" -#if defined MACOSX +#if defined MACOSX || defined LINUX #include <dirent.h> #include <osl/thread.h> #endif @@ -38,7 +38,7 @@ namespace { // original spelling of a file name (not even with // osl_FileStatus_Mask_Validate): OUString getFileName(OUString const & uri, osl::FileStatus const & status) { -#if defined MACOSX +#if defined MACOSX || defined LINUX sal_Int32 i = uri.lastIndexOf('/') + 1; OUString path; if (osl::FileBase::getSystemPathFromFileURL(uri.copy(0, i), path) @@ -59,7 +59,12 @@ OUString getFileName(OUString const & uri, osl::FileStatus const & status) { for (;;) { dirent ent; dirent * p; + + // readdir_r() is deprecated in current POSIX + SAL_WNODEPRECATED_DECLARATIONS_PUSH int e = readdir_r(d, &ent, &p); + SAL_WNODEPRECATED_DECLARATIONS_POP + if (e != 0) { SAL_WARN("unoidl", "cannot readdir_r"); closedir(d);
