Fix WinAPI watcher to be consistent.

This commit is contained in:
Sönke Ludwig 2017-11-22 17:14:31 +01:00
parent a9ae496fb4
commit 16e95b03e8

View file

@ -123,6 +123,7 @@ final class WinAPIEventDriverWatchers : EventDriverWatchers {
auto path = () @trusted { scope (failure) assert(false); return to!string(fni.FileName[0 .. fni.FileNameLength/2]); } (); auto path = () @trusted { scope (failure) assert(false); return to!string(fni.FileName[0 .. fni.FileNameLength/2]); } ();
auto fullpath = buildPath(slot.directory, path); auto fullpath = buildPath(slot.directory, path);
ch.directory = dirName(path); ch.directory = dirName(path);
if (ch.directory == ".") ch.directory = "";
ch.name = baseName(path); ch.name = baseName(path);
try ch.isDirectory = isDir(fullpath); try ch.isDirectory = isDir(fullpath);
catch (Exception e) {} // FIXME: can happen if the base path is relative and the CWD has changed catch (Exception e) {} // FIXME: can happen if the base path is relative and the CWD has changed