--- libfm-1.2.5/src/base/fm-app-info.c.orig 2016-12-09 00:44:54.000000000 +0100 +++ libfm-1.2.5/src/base/fm-app-info.c 2016-12-14 16:03:01.929458947 +0100 @@ -73,24 +73,28 @@ static void append_uri_to_cmd(GFile* gf, GString* cmd) { char* uri = NULL; - if(!g_file_has_uri_scheme(gf, "file")) + if(g_pattern_match_simple("*libreoffice*", cmd->str)) + uri = g_file_get_uri(gf); + else { - /* When gvfs-fuse is in use, try to convert all URIs that are not file:// to - * their corresponding FUSE-mounted local paths. GDesktopAppInfo internally does this, too. - * With this, non-gtk+ applications can correctly open files in gvfs-mounted remote filesystems. - */ - char* path = g_file_get_path(gf); - if(path) + if(!g_file_has_uri_scheme(gf, "file")) { - uri = g_filename_to_uri(path, NULL, NULL); - g_free(path); + /* When gvfs-fuse is in use, try to convert all URIs that are not file:// to + * their corresponding FUSE-mounted local paths. GDesktopAppInfo internally does this, too. + * With this, non-gtk+ applications can correctly open files in gvfs-mounted remote filesystems. + */ + char* path = g_file_get_path(gf); + if(path) + { + uri = g_filename_to_uri(path, NULL, NULL); + g_free(path); + } + } + if(!uri) + { + uri = g_file_get_uri(gf); } } - if(!uri) - { - uri = g_file_get_uri(gf); - } - if(uri) { char* quote = g_shell_quote(uri);