summaryrefslogtreecommitdiff
path: root/src/Fl_File_Chooser2.cxx
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2005-05-12 15:01:24 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2005-05-12 15:01:24 +0000
commit56e89999abc137213fae006606b889eb1534faf7 (patch)
treea0ed7d58315b93a8251b80109533c3019f367cdd /src/Fl_File_Chooser2.cxx
parent3ce3d62e9c5cbc3a07e8aa8226100caf742cd9e7 (diff)
Fl_File_Chooser now returns directory names with a trailing slash
to avoid problems with relative filenames (STR #819) git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4335 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_File_Chooser2.cxx')
-rw-r--r--src/Fl_File_Chooser2.cxx23
1 files changed, 2 insertions, 21 deletions
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index 6c7ebc084..98a3f0f13 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -1039,15 +1039,7 @@ Fl_File_Chooser::value(int f) // I - File number
if (!(type_ & MULTI)) {
// Return the filename in the filename field...
if (!name || !name[0]) return NULL;
- else if (fl_filename_isdir(name)) {
- if (type_ & DIRECTORY) {
- // Strip trailing slash, if any...
- strlcpy(pathname, name, sizeof(pathname));
- slash = pathname + strlen(pathname) - 1;
- if (*slash == '/') *slash = '\0';
- return pathname;
- } else return NULL;
- } else return name;
+ else return name;
}
// Return a filename from the list...
@@ -1065,24 +1057,13 @@ Fl_File_Chooser::value(int f) // I - File number
strlcpy(pathname, name, sizeof(pathname));
}
- // Strip trailing slash, if any...
- slash = pathname + strlen(pathname) - 1;
- if (*slash == '/') *slash = '\0';
return pathname;
}
}
// If nothing is selected, use the filename field...
if (!name || !name[0]) return NULL;
- else if (fl_filename_isdir(name)) {
- if (type_ & DIRECTORY) {
- // Strip trailing slash, if any...
- strlcpy(pathname, name, sizeof(pathname));
- slash = pathname + strlen(pathname) - 1;
- if (*slash == '/') *slash = '\0';
- return pathname;
- } else return NULL;
- } else return name;
+ else return name;
}