Skip to content

Commit

Permalink
Fixed calling WinAPI with a non-UNC path
Browse files Browse the repository at this point in the history
  • Loading branch information
VioletGiraffe committed Sep 11, 2024
1 parent 81021f1 commit ca1a044
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions file-commander-core/src/cfilesystemobject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "assert/advanced_assert.h"
#include "hash/wheathash.hpp"
#include "lang/type_traits_fast.hpp"
#include "windows/windowsutils.h"


#ifdef CFILESYSTEMOBJECT_TEST
Expand Down Expand Up @@ -263,9 +264,8 @@ bool CFileSystemObject::isEmptyDir() const

#ifdef _WIN32
WCHAR path[32768];
const auto nChars = _properties.fullPath.toWCharArray(path);
path[nChars] = 0;
return PathIsDirectoryEmptyW(path) != 0;
toUncWcharArray(_properties.fullPath, path);
return ::PathIsDirectoryEmptyW(path) != 0;
#else
// TODO: use getdents64 on Linux
DIR *dir = ::opendir(_properties.fullPath.toLocal8Bit().constData());
Expand Down

0 comments on commit ca1a044

Please sign in to comment.