aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2013-02-19 12:21:17 +0100
committerThomas White <taw@physics.org>2013-02-19 12:22:12 +0100
commit9aa90dd1f81f7ec449dad1e1da0cfd67eef65150 (patch)
tree149fab1c9240cd5d8dc50522ce02ff6843c8ebfb /src
parent277197d8f482229e29b05db1fa4adc866c72e1ee (diff)
Don't add ../../ to the filename if it's already absolute
Diffstat (limited to 'src')
-rw-r--r--src/im-sandbox.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/im-sandbox.c b/src/im-sandbox.c
index aeeb023c..5d42d17d 100644
--- a/src/im-sandbox.c
+++ b/src/im-sandbox.c
@@ -191,7 +191,9 @@ static void process_image(const struct index_args *iargs,
char filename[1024];
/* Prefix to jump out of temporary folder */
- snprintf(filename, 1023, "../../%s", pargs->filename);
+ if ( pargs->filename[0] != '/' ) {
+ snprintf(filename, 1023, "../../%s", pargs->filename);
+ }
image.features = NULL;
image.data = NULL;