summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FL/platform_types.h1
-rw-r--r--src/Fl_File_Chooser2.cxx2
-rw-r--r--src/filename_isdir.cxx2
3 files changed, 2 insertions, 3 deletions
diff --git a/FL/platform_types.h b/FL/platform_types.h
index e8fbe86ca..a5b51be2b 100644
--- a/FL/platform_types.h
+++ b/FL/platform_types.h
@@ -66,7 +66,6 @@ struct stat { /* the FLTK source code uses part of the stat() API */
unsigned st_mode;
unsigned st_size;
};
-#define S_IFMT 0170000 /* type of file */
#define S_IFDIR 0040000 /* directory */
#define S_IFREG 0100000 /* regular */
diff --git a/src/Fl_File_Chooser2.cxx b/src/Fl_File_Chooser2.cxx
index b5b5df3f8..9be64784d 100644
--- a/src/Fl_File_Chooser2.cxx
+++ b/src/Fl_File_Chooser2.cxx
@@ -1333,7 +1333,7 @@ Fl_File_Chooser::update_preview()
} else {
struct stat s;
if (fl_stat(filename, &s)==0) {
- if ((s.st_mode&S_IFMT)!=S_IFREG) {
+ if ((s.st_mode & S_IFREG) == 0) {
// this is no regular file, probably some kind of device
newlabel = "@-3refresh"; // a cross
set = 1;
diff --git a/src/filename_isdir.cxx b/src/filename_isdir.cxx
index 378f17e4e..8364742da 100644
--- a/src/filename_isdir.cxx
+++ b/src/filename_isdir.cxx
@@ -65,7 +65,7 @@ int Fl_System_Driver::filename_isdir(const char* n) {
fn[length] = '\0';
n = fn;
}
- return !stat(n, &s) && (s.st_mode & S_IFMT) == S_IFDIR;
+ return !stat(n, &s) && (s.st_mode & S_IFDIR);
}
//