summaryrefslogtreecommitdiffstats
path: root/src/extension/system.cpp
diff options
context:
space:
mode:
authorJohan B. C. Engelen <jbc.engelen@swissonline.ch>2012-04-28 09:24:18 +0000
committerJohan B. C. Engelen <j.b.c.engelen@alumnus.utwente.nl>2012-04-28 09:24:18 +0000
commit8b6b45cf07aa5abff73aaa765f79f480b9f9de5e (patch)
treedeee4b182cd36e6e14e8c877f220e318a4b307cd /src/extension/system.cpp
parentfix paths when working with command line (Bug #695120 , patch by Patrick Monn... (diff)
downloadinkscape-8b6b45cf07aa5abff73aaa765f79f480b9f9de5e.tar.gz
inkscape-8b6b45cf07aa5abff73aaa765f79f480b9f9de5e.zip
C++ify syntax a bit
(bzr r11300)
Diffstat (limited to 'src/extension/system.cpp')
-rw-r--r--src/extension/system.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/extension/system.cpp b/src/extension/system.cpp
index cf78cd2b8..476499385 100644
--- a/src/extension/system.cpp
+++ b/src/extension/system.cpp
@@ -68,17 +68,14 @@ static Extension *build_from_reprdoc(Inkscape::XML::Document *doc, Implementatio
*/
SPDocument *open(Extension *key, gchar const *filename)
{
- Input *imod = NULL;
- int relpath;
- gchar * curdir;
-
// Convert to absolute pathname to tolerate chdir().
- relpath = *filename != '/';
+ bool relpath = (filename[0] != '/');
#ifdef WIN32
- relpath &= *filename != '\\' && !(isalpha(*filename) && filename[1] == ':');
+ relpath &= (filename[0] != '\\') && !(isalpha(filename[0]) && (filename[1] == ':'));
#endif
if (relpath) {
+ gchar * curdir = NULL;
#ifndef WIN32
curdir = getcwd(NULL, 0);
#else
@@ -88,7 +85,9 @@ SPDocument *open(Extension *key, gchar const *filename)
filename = g_build_filename(curdir, filename, NULL);
free(curdir);
}
-
+
+ Input *imod = NULL;
+
if (key == NULL) {
gpointer parray[2];
parray[0] = (gpointer)filename;