projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
output: Rename caption to title.
[pspp]
/
src
/
data
/
file-name.c
diff --git
a/src/data/file-name.c
b/src/data/file-name.c
index 5e4080b11f22ffa463f4bc0264b68de2736abd25..fa0eb794010f75b9b2666334c08b827422ed04bd 100644
(file)
--- a/
src/data/file-name.c
+++ b/
src/data/file-name.c
@@
-128,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. */
@@
-166,7
+170,7
@@
fn_getenv_default (const char *key, const char *def)
static FILE *
safety_violation (const char *fn)
{
static FILE *
safety_violation (const char *fn)
{
- msg (SE, _("Not opening pipe file `%s' because
SAFER option set."), fn
);
+ msg (SE, _("Not opening pipe file `%s' because
%s option set."), fn, "SAFER"
);
errno = EPERM;
return NULL;
}
errno = EPERM;
return NULL;
}