diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2003-05-28 16:38:09 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2003-05-28 16:38:09 +0000 |
| commit | 0753014e309d94f28a04893fddb25f175417b8af (patch) | |
| tree | 15057a8596d5e5a14fbbf02e914d70edc1b4b2fa | |
| parent | 5ccb6afda8e50a7ac17c318defe57eaeb136c97d (diff) | |
fl_filename_list returns -1 now (Win32) if it was called with
a non-existing directory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3014 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | CHANGES | 2 | ||||
| -rw-r--r-- | src/scandir_win32.c | 11 |
2 files changed, 8 insertions, 5 deletions
@@ -1,5 +1,7 @@ CHANGES IN FLTK 1.1.4 + - fl_filename_list returned 0 on Win32 if no directory + existed (STR #54) - Pressing 'home' after the last letter in a Text_Editor would move the cursor to pos 0 (STR #39) - Fl::get_key(x) would mix up Ctrl and Meta on OS X (STR diff --git a/src/scandir_win32.c b/src/scandir_win32.c index 44223f5b8..9c5612f23 100644 --- a/src/scandir_win32.c +++ b/src/scandir_win32.c @@ -1,5 +1,5 @@ /* - * "$Id: scandir_win32.c,v 1.11.2.4.2.6 2003/01/30 21:44:38 easysw Exp $" + * "$Id: scandir_win32.c,v 1.11.2.4.2.7 2003/05/28 16:38:09 matthiaswm Exp $" * * WIN32 scandir function for the Fast Light Tool Kit (FLTK). * @@ -45,7 +45,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, len = strlen(dirname); findIn = malloc(len+5); - if (!findIn) return 0; + if (!findIn) return -1; strcpy(findIn, dirname); for (d = findIn; *d; d++) if (*d=='/') *d='\\'; @@ -58,7 +58,7 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, free(findIn); ret = GetLastError(); if (ret != ERROR_NO_MORE_FILES) { - /* TODO: return some error code */ + nDir = -1; } *namelist = dir; return nDir; @@ -87,7 +87,8 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, } while (FindNextFile(h, &find)); ret = GetLastError(); if (ret != ERROR_NO_MORE_FILES) { - /* TODO: return some error code */ + /* don't return an error code, because the dir list may still be valid + up to this point */ } FindClose(h); @@ -103,5 +104,5 @@ int fl_scandir(const char *dirname, struct dirent ***namelist, #endif /* - * End of "$Id: scandir_win32.c,v 1.11.2.4.2.6 2003/01/30 21:44:38 easysw Exp $". + * End of "$Id: scandir_win32.c,v 1.11.2.4.2.7 2003/05/28 16:38:09 matthiaswm Exp $". */ |
