summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES2
-rw-r--r--src/Fl_File_Chooser2.cxx32
2 files changed, 17 insertions, 17 deletions
diff --git a/CHANGES b/CHANGES
index ee1cc73de..dc2a9d18e 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.4
+ - Fl_File_Chooser was very close for multiple file
+ selection in large directories (STR #140)
- Fl_Text_Display/Editor did not disable the current
selection when focus was shifted to another widget
(STR #131)
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 914f72809..ce1c5d25c 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.31 2003/05/26 01:39:53 easysw Exp $"
+// "$Id: Fl_File_Chooser2.cxx,v 1.1.2.32 2003/09/03 19:38:01 easysw Exp $"
//
// More Fl_File_Chooser routines.
//
@@ -112,7 +112,6 @@ Fl_File_Chooser::count()
int i; // Looping var
int fcount; // Number of selected files
const char *filename; // Filename in input field or list
- char pathname[1024]; // Full path to file
if (!(type_ & MULTI))
@@ -134,12 +133,8 @@ Fl_File_Chooser::count()
{
// See if this file is a directory...
filename = (char *)fileList->text(i);
- if (directory_[0] != '\0')
- snprintf(pathname, sizeof(pathname), "%s/%s", directory_, filename);
- else
- strlcpy(pathname, filename, sizeof(pathname));
- if (!fl_filename_isdir(pathname))
+ if (filename[strlen(filename) - 1] != '/')
fcount ++;
}
@@ -1027,16 +1022,19 @@ Fl_File_Chooser::value(int f) // I - File number
// See if this file is a directory...
name = fileList->text(i);
- if (directory_[0]) {
- snprintf(pathname, sizeof(pathname), "%s/%s", directory_, name);
- } else {
- strlcpy(pathname, name, sizeof(pathname));
- }
-
- if (!fl_filename_isdir(pathname)) {
- // Nope, see if this this is "the one"...
+ if (name[strlen(name) - 1] != '/') {
+ // Not a directory, see if this this is "the one"...
fcount ++;
- if (fcount == f) return (pathname);
+
+ if (fcount == f) {
+ if (directory_[0]) {
+ snprintf(pathname, sizeof(pathname), "%s/%s", directory_, name);
+ } else {
+ strlcpy(pathname, name, sizeof(pathname));
+ }
+
+ return (pathname);
+ }
}
}
@@ -1165,5 +1163,5 @@ unquote_pathname(char *dst, // O - Destination string
//
-// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.31 2003/05/26 01:39:53 easysw Exp $".
+// End of "$Id: Fl_File_Chooser2.cxx,v 1.1.2.32 2003/09/03 19:38:01 easysw Exp $".
//