diff --git a/src/mime.c b/src/mime.c index 9ae785d..e229498 100644 --- a/src/mime.c +++ b/src/mime.c @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2011-2017 Pierre Pronchery */ +/* Copyright (c) 2011-2018 Pierre Pronchery */ /* This file is part of DeforaOS libDesktop */ /* All rights reserved. * @@ -275,17 +275,21 @@ static MimeHandler * _get_handler_executable(char const * type, char const * program) { MimeHandler * handler; + String * p; if((handler = mimehandler_new()) == NULL) return NULL; - if(mimehandler_set(handler, "Type", "Application") != 0 + if((p = string_new_append(program, " %f", NULL)) == NULL + || mimehandler_set(handler, "Type", "Application") != 0 || mimehandler_set(handler, "Name", program) != 0 || mimehandler_set(handler, "MimeType", type) != 0 - || mimehandler_set(handler, "Exec", program) != 0) + || mimehandler_set(handler, "Exec", p) != 0) { + string_delete(p); mimehandler_delete(handler); return NULL; } + string_delete(p); return handler; } diff --git a/src/mimehandler.h b/src/mimehandler.h index e74c9e1..39ef1ac 100644 --- a/src/mimehandler.h +++ b/src/mimehandler.h @@ -1,5 +1,5 @@ /* $Id$ */ -/* Copyright (c) 2017-2018 Pierre Pronchery */ +/* Copyright (c) 2018 Pierre Pronchery */ /* This file is part of DeforaOS Desktop libDesktop */ /* All rights reserved. *