Linux: Fix recent entries with quote in filename

According to RFC 2396, the single quote character (') is allowed in uri
strings and is not escaped by gtk, so the action string constructed for
the recent files menu must be quoted with " instead of '.

This fixes issue #437
This commit is contained in:
Ingo Saitz 2021-11-19 09:32:18 +01:00 committed by linkmauve
parent 629724d865
commit 327dcd3d7b
1 changed files with 1 additions and 1 deletions

View File

@ -3383,7 +3383,7 @@ common_gtk_main(GApplication *app, gpointer user_data)
const char *name = gtk_recent_info_get_display_name(info);
// TODO: Is that enough? Maybe allocate instead?
char action[1024];
sprintf(action, "app.recent('%s')", uri);
sprintf(action, "app.recent(\"%s\")", uri);
g_menu_append(G_MENU(user_data), name, action);
gtk_recent_info_unref(info);