summaryrefslogtreecommitdiffstats
path: root/src/io/sys.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/io/sys.cpp')
-rw-r--r--src/io/sys.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/io/sys.cpp b/src/io/sys.cpp
index 60e850c96..94175176a 100644
--- a/src/io/sys.cpp
+++ b/src/io/sys.cpp
@@ -227,8 +227,10 @@ bool Inkscape::IO::file_is_writable( char const *utf8name)
}
if ( filename ) {
struct stat st;
- if(g_lstat (filename, &st) == 0) {
- success = ((st.st_mode & S_IWRITE) != 0);
+ if (g_file_test (filename, G_FILE_TEST_EXISTS)){
+ if (g_lstat (filename, &st) == 0) {
+ success = ((st.st_mode & S_IWRITE) != 0);
+ }
}
g_free(filename);
filename = NULL;