summaryrefslogtreecommitdiff
path: root/src/drivers/Android/Fl_Android_System_Driver.cxx
diff options
context:
space:
mode:
authorGreg Ercolano <erco@seriss.com>2020-07-10 21:49:00 -0700
committerAlbrecht Schlosser <albrechts.fltk@online.de>2020-07-14 12:52:56 +0200
commit0693c70f577624e66fd660a888f2d2bcd3fc180b (patch)
treee3b4161c0516ebacaf84e9b58852f48d4e4b6357 /src/drivers/Android/Fl_Android_System_Driver.cxx
parent9925b0f12852dc37fb7fb773a525486c258d2c62 (diff)
First pass at fixing issue 99
A lot of code touched because low level functions needed to pass up error messages reliably, and this had to propagate up the entire driver hierarchy. Tested OK *in English* on: > Linux > OSX 10.10.x > Windows VS2017 > Windows mingw64 I have no way to test on Android, but it might work. TODO: Needs testing in other languages to verify proper UTF8 error messages, esp. with Windows VS, due to complexities with FormatMessage() -- see get_ms_errmsg()
Diffstat (limited to 'src/drivers/Android/Fl_Android_System_Driver.cxx')
-rw-r--r--src/drivers/Android/Fl_Android_System_Driver.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/drivers/Android/Fl_Android_System_Driver.cxx b/src/drivers/Android/Fl_Android_System_Driver.cxx
index e6aa970e4..0fa9671c5 100644
--- a/src/drivers/Android/Fl_Android_System_Driver.cxx
+++ b/src/drivers/Android/Fl_Android_System_Driver.cxx
@@ -486,11 +486,13 @@ int Fl_WinAPI_System_Driver::clocale_printf(FILE *output, const char *format, va
return retval;
}
-int Fl_WinAPI_System_Driver::filename_list(const char *d, dirent ***list, int (*sort)(struct dirent **, struct dirent **) ) {
+int Fl_WinAPI_System_Driver::filename_list(const char *d, dirent ***list,
+ int (*sort)(struct dirent **, struct dirent **),
+ char *errmsg, int errmsg_sz ) {
// For Windows we have a special scandir implementation that uses
// the Win32 "wide" functions for lookup, avoiding the code page mess
// entirely. It also fixes up the trailing '/'.
- return fl_scandir(d, list, 0, sort);
+ return fl_scandir(d, list, 0, sort, errmsg, errmsg_sz);
}
int Fl_WinAPI_System_Driver::filename_expand(char *to, int tolen, const char *from) {
@@ -747,7 +749,9 @@ int Fl_WinAPI_System_Driver::file_browser_load_filesystem(Fl_File_Browser *brows
}
int Fl_WinAPI_System_Driver::file_browser_load_directory(const char *directory, char *filename,
- size_t name_size, dirent ***pfiles, Fl_File_Sort_F *sort)
+ size_t name_size, dirent ***pfiles,
+ Fl_File_Sort_F *sort,
+ char *errmsg, int errmsg_sz)
{
strlcpy(filename, directory, name_size);
int i = (int) (strlen(filename) - 1);
@@ -756,7 +760,7 @@ int Fl_WinAPI_System_Driver::file_browser_load_directory(const char *directory,
filename[2] = '/';
else if (filename[i] != '/' && filename[i] != '\\')
strlcat(filename, "/", name_size);
- return filename_list(filename, pfiles, sort);
+ return filename_list(filename, pfiles, sort, errmsg, errmsg_sz);
}
void Fl_WinAPI_System_Driver::newUUID(char *uuidBuffer)