summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_File_Input.cxx11
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.H1
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx7
3 files changed, 11 insertions, 8 deletions
diff --git a/src/Fl_File_Input.cxx b/src/Fl_File_Input.cxx
index 8d1584468..be343d9b6 100644
--- a/src/Fl_File_Input.cxx
+++ b/src/Fl_File_Input.cxx
@@ -18,6 +18,7 @@
//
#include <FL/Fl.H>
+#include <FL/Fl_System_Driver.H>
#include <FL/Fl_File_Input.H>
#include <FL/Fl_Window.H>
#include <FL/fl_draw.H>
@@ -112,10 +113,7 @@ void Fl_File_Input::update_buttons() {
start && i < (int)(sizeof(buttons_) / sizeof(buttons_[0]) - 1);
start = end, i ++) {
// printf(" start = \"%s\"\n", start);
- if ((end = strchr(start, '/')) == NULL)
-#if defined(WIN32) || defined(__EMX__)
- if ((end = strchr(start, '\\')) == NULL)
-#endif // WIN32 || __EMX__
+ if ((end = Fl::system_driver()->next_dir_sep(start)) == NULL)
break;
end ++;
@@ -261,10 +259,7 @@ Fl_File_Input::handle_button(int event) // I - Event
for (start = newvalue, end = start; start && i >= 0; start = end, i --) {
// printf(" start = \"%s\"\n", start);
- if ((end = strchr(start, '/')) == NULL)
-#if defined(WIN32) || defined(__EMX__)
- if ((end = strchr(start, '\\')) == NULL)
-#endif // WIN32 || __EMX__
+ if ((end = (char*)Fl::system_driver()->next_dir_sep(start)) == NULL)
break;
end ++;
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
index 5e580f15c..5ffe037a2 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.H
@@ -84,6 +84,7 @@ public:
const char *application);
virtual void *dlopen(const char *filename);
virtual void png_extra_rgba_processing(unsigned char *array, int w, int h);
+ virtual const char *next_dir_sep(const char *start);
};
#endif // FL_WINAPI_SYSTEM_DRIVER_H
diff --git a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
index 529f9ade7..5b9676fdf 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_System_Driver.cxx
@@ -877,6 +877,13 @@ void Fl_WinAPI_System_Driver::png_extra_rgba_processing(unsigned char *ptr, int
}
}
+const char *Fl_WinAPI_System_Driver::next_dir_sep(const char *start)
+{
+ const char *p = strchr(start, '/');
+ if (!p) p = strchr(start, '\\');
+ return p;
+}
+
//
// End of "$Id$".
//