summaryrefslogtreecommitdiff
path: root/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-06 15:49:52 +0000
committerManolo Gouy <Manolo>2016-04-06 15:49:52 +0000
commitae0d15f1a3f133a2b2aa403c115b72819f1ac5ae (patch)
tree2e03716f4b145b75fea11fef0d0bba388c6c8712 /src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
parentd905769e6912039a318cdccfe7cd6dc510d254d6 (diff)
Begin to rewrite files using #include <sys/stat.h> under the driver model.
struct stat is considered a platform-specific type. The Unix, Mac OS, and WIN32 platforms define it with #include <sys/stat.h> 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
Diffstat (limited to 'src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx')
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx1
1 files changed, 1 insertions, 0 deletions
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