diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 04:59:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-09-12 04:59:58 +0000 |
commit | b8d375bcb1f462d5af5d1f480b32d7b0038417f6 (patch) | |
tree | 93d48ade79cc9d5892f17ff41c33753be6bb0879 /file_io/win32/dir.c | |
parent | Adding upstream version 1.7.2. (diff) | |
download | apr-65b31256e162b98a509eedfd4c31fa39ca738c80.tar.xz apr-65b31256e162b98a509eedfd4c31fa39ca738c80.zip |
Adding upstream version 1.7.5.upstream/1.7.5upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'file_io/win32/dir.c')
-rw-r--r-- | file_io/win32/dir.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/file_io/win32/dir.c b/file_io/win32/dir.c index 8c8b745..e4e3f7c 100644 --- a/file_io/win32/dir.c +++ b/file_io/win32/dir.c @@ -128,6 +128,8 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, if (thedir->dirhand == INVALID_HANDLE_VALUE) { apr_status_t rv; + FINDEX_INFO_LEVELS info_level; + if ((rv = utf8_to_unicode_path(wdirname, sizeof(wdirname) / sizeof(apr_wchar_t), thedir->dirname))) { @@ -136,7 +138,19 @@ APR_DECLARE(apr_status_t) apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted, eos = wcschr(wdirname, '\0'); eos[0] = '*'; eos[1] = '\0'; - thedir->dirhand = FindFirstFileW(wdirname, thedir->w.entry); + + /* Do not request short file names on Windows 7 and later. */ + if (apr_os_level >= APR_WIN_7) { + info_level = FindExInfoBasic; + } + else { + info_level = FindExInfoStandard; + } + + thedir->dirhand = FindFirstFileExW(wdirname, info_level, + thedir->w.entry, + FindExSearchNameMatch, NULL, + 0); eos[0] = '\0'; if (thedir->dirhand == INVALID_HANDLE_VALUE) { return apr_get_os_error(); |