projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Update widgets.c from psppsheet branch
[pspp]
/
src
/
data
/
file-name.c
diff --git
a/src/data/file-name.c
b/src/data/file-name.c
index 2988d50295b073482b3bee10f274834a56bec6d0..9eeb4b1cfc06309e45c0777ef1277aa0fbeb4894 100644
(file)
--- a/
src/data/file-name.c
+++ b/
src/data/file-name.c
@@
-33,6
+33,7
@@
#include "libpspp/version.h"
#include "gl/dirname.h"
#include "libpspp/version.h"
#include "gl/dirname.h"
+#include "gl/dosname.h"
#include "gl/intprops.h"
#include "gl/minmax.h"
#include "gl/relocatable.h"
#include "gl/intprops.h"
#include "gl/minmax.h"
#include "gl/relocatable.h"
@@
-127,12
+128,16
@@
fn_is_special (const char *file_name)
return false;
}
return false;
}
-/* Returns true if file with name NAME exists. */
+/* Returns true if file with name NAME exists, and that file is not a
+ directory */
bool
fn_exists (const char *name)
{
struct stat temp;
bool
fn_exists (const char *name)
{
struct stat temp;
- return stat (name, &temp) == 0;
+ if ( stat (name, &temp) != 0 )
+ return false;
+
+ return ! S_ISDIR (temp.st_mode);
}
\f
/* Environment variables. */
}
\f
/* Environment variables. */