X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f3b1d0fc56fd93f17244c186d7f961797efc35e3..1ee968ea97b66a9795f76c4030874be0faa632d5:/src/unix/fswatcher_kqueue.cpp

diff --git a/src/unix/fswatcher_kqueue.cpp b/src/unix/fswatcher_kqueue.cpp
index 41ecbdede7..5229e5139b 100644
--- a/src/unix/fswatcher_kqueue.cpp
+++ b/src/unix/fswatcher_kqueue.cpp
@@ -314,17 +314,12 @@ protected:
                 wxArrayInt::iterator changeType = changedFlags.begin();
                 for ( ; it != changedFiles.end(); ++it, ++changeType )
                 {
-                    wxFileName path;
-                    if ( wxDirExists(*it) )
-                    {
-                        path = wxFileName::DirName(
-                                basepath + wxFileName::GetPathSeparator() + *it
-                               );
-                    }
-                    else
-                    {
-                        path.Assign(basepath, *it);
-                    }
+                    const wxString fullpath = w.GetPath() +
+                                                wxFileName::GetPathSeparator() +
+                                                  *it;
+                    const wxFileName path(wxDirExists(fullpath)
+                                            ? wxFileName::DirName(fullpath)
+                                            : wxFileName::FileName(fullpath));
 
                     wxFileSystemWatcherEvent event(*changeType, path, path);
                     SendEvent(event);