diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-08-18 14:08:17 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2005-08-18 14:08:17 +0000 |
| commit | c1ba87140e22e9e7b46fe90c0f98e38b7c8a94ca (patch) | |
| tree | 19081ab89fb59d334623c584c872e99ddb4be57c /src/filename_isdir.cxx | |
| parent | eca40efb6e42b352ca77d1d290b4149037b70efd (diff) | |
Fix new trailing slash usage, and restore correct OSX filesystem listing
(added filter to hide /dev and /.vol)
src/Fl_File_Browser.cxx:
- Fl_File_Browser::load(): use getfsstat() API on OSX, and don't
bother adding a trailing slash to directories since we already
have them!
src/filename_list.cxx:
- fl_filename_list(): Add 3 bytes (two possible slashes + nul byte)
to temporary buffer, and document why we are using memcpy() instead
of strcpy().
src/filename_isdir.cxx:
- fl_filename_isdir(): Add check for trailing directory separator
before wasting time doing a stat() call.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4526 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/filename_isdir.cxx')
| -rw-r--r-- | src/filename_isdir.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/filename_isdir.cxx b/src/filename_isdir.cxx index e368fce1d..f1a3d2909 100644 --- a/src/filename_isdir.cxx +++ b/src/filename_isdir.cxx @@ -43,6 +43,9 @@ static inline int isdirsep(char c) {return c=='/' || c=='\\';} int fl_filename_isdir(const char* n) { struct stat s; + // Do a quick optimization for filenames with a trailing slash... + if (*n && isdirsep(n[strlen(n) - 1])) return 1; + #ifdef WIN32 char fn[1024]; int length; |
