From 9aa90dd1f81f7ec449dad1e1da0cfd67eef65150 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 19 Feb 2013 12:21:17 +0100 Subject: Don't add ../../ to the filename if it's already absolute --- src/im-sandbox.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3