diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-04-03 20:47:48 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-04-03 20:47:48 +0000 |
| commit | 3c213cec8c2aab1a53d0d5cb9d87659b584ac876 (patch) | |
| tree | c999ceaf1d985a8a3eee1f6dce37ebc7930ca9e0 /src/io/sys.cpp | |
| parent | Translations. Latvian translation update by Jānis Eisaks. (diff) | |
| download | inkscape-3c213cec8c2aab1a53d0d5cb9d87659b584ac876.tar.gz inkscape-3c213cec8c2aab1a53d0d5cb9d87659b584ac876.zip | |
Checking file presence before calling lstat (should fix Bug #785701 Inkscape freezes at opening)
(bzr r12263)
Diffstat (limited to 'src/io/sys.cpp')
| -rw-r--r-- | src/io/sys.cpp | 6 |
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; |
