From ae0d15f1a3f133a2b2aa403c115b72819f1ac5ae Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 6 Apr 2016 15:49:52 +0000 Subject: Begin to rewrite files using #include under the driver model. struct stat is considered a platform-specific type. The Unix, Mac OS, and WIN32 platforms define it with #include Other platforms may do that their own way. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11542 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx | 1 + 1 file changed, 1 insertion(+) (limited to 'src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx') diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx index 3a0b94fc5..46bd9dc78 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx @@ -196,6 +196,7 @@ int Fl_WinAPI_System_Driver::access(const char* f, int mode) { int Fl_WinAPI_System_Driver::stat(const char* f, struct stat *b) { size_t l = strlen(f); + if (f[l-1] == '/') l--; // must remove trailing / unsigned wn = fl_utf8toUtf16(f, (unsigned) l, NULL, 0) + 1; // Query length wbuf = (wchar_t*)realloc(wbuf, sizeof(wchar_t)*wn); wn = fl_utf8toUtf16(f, (unsigned) l, (unsigned short *)wbuf, wn); // Convert string -- cgit v1.2.3