summaryrefslogtreecommitdiffstats
path: root/src/inkview.cpp
diff options
context:
space:
mode:
authorEduard Braun <eduard.braun2@gmx.de>2017-05-13 16:56:35 +0000
committerEduard Braun <eduard.braun2@gmx.de>2017-05-13 16:56:35 +0000
commitc5f6ddd9b268dd6b5165a2353ee1a893075da91a (patch)
tree21a9723a3afe3fe5325b34af481989602a2fcdd1 /src/inkview.cpp
parentFix build warning (diff)
downloadinkscape-c5f6ddd9b268dd6b5165a2353ee1a893075da91a.tar.gz
inkscape-c5f6ddd9b268dd6b5165a2353ee1a893075da91a.zip
Inkview: Fix loading files with non-ASCII characters in filename
Fixed bugs: - https://launchpad.net/bugs/488997 (bzr r15690.1.1)
Diffstat (limited to 'src/inkview.cpp')
-rw-r--r--src/inkview.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/inkview.cpp b/src/inkview.cpp
index b52d69825..1848cccd3 100644
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
@@ -31,7 +31,6 @@
#endif
#include <cstring>
-#include <sys/stat.h>
#include <locale.h>
@@ -53,6 +52,8 @@
#include "document.h"
#include "svg-view.h"
#include "svg-view-widget.h"
+
+#include "io/sys.h"
#include "util/units.h"
#ifdef ENABLE_NLS
#include "helper/gettext.h"
@@ -289,10 +290,8 @@ int main (int argc, char **argv)
for(auto file : filenames)
{
- struct stat st;
- if (stat(file.c_str(), &st)
- || !S_ISREG (st.st_mode)
- || (st.st_size < 64)) {
+ if (!Inkscape::IO::file_test( file.c_str(), G_FILE_TEST_EXISTS ))
+ {
std::cerr << "could not open file " << file << std::endl;
} else {
auto doc = SPDocument::createNewDoc(file.c_str(), TRUE, false);