diff --git a/exo-0.10.6-escaped-uri.patch b/exo-0.10.6-escaped-uri.patch new file mode 100644 index 0000000..bb14c53 --- /dev/null +++ b/exo-0.10.6-escaped-uri.patch @@ -0,0 +1,102 @@ +diff -Nur exo-0.10.6.orig/exo-open/main.c exo-0.10.6/exo-open/main.c +--- exo-0.10.6.orig/exo-open/main.c 2015-05-25 12:04:45.000000000 -0600 ++++ exo-0.10.6/exo-open/main.c 2015-07-31 13:16:51.148691020 -0600 +@@ -206,11 +206,17 @@ + { + gchar *current_dir; + gchar *uri; ++ gchar *escaped_uri; + gchar *path; + + /* is an absolute path, return file uri */ + if (g_path_is_absolute (string)) +- return g_strconcat ("file://", string, NULL); ++ { ++ uri = g_strconcat ("file://", string, NULL); ++ escaped_uri = g_uri_escape_string (uri, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE); ++ g_free(uri); ++ return escaped_uri; ++ } + + /* treat it like a relative path */ + current_dir = g_get_current_dir (); +@@ -221,8 +227,10 @@ + if (g_file_test (path, G_FILE_TEST_EXISTS)) + { + uri = g_strconcat ("file://", path, NULL); ++ escaped_uri = g_uri_escape_string (uri, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE); + g_free (path); +- return uri; ++ g_free (uri); ++ return escaped_uri; + } + g_free (path); + +@@ -307,7 +315,6 @@ + { + GFile *file; + gchar *scheme; +- gchar *escaped; + GFileInfo *file_info; + gboolean succeed = FALSE; + gboolean retval = FALSE; +@@ -331,15 +338,13 @@ + g_free (scheme); + #endif + +- escaped = g_uri_escape_string (uri, G_URI_RESERVED_CHARS_ALLOWED_IN_PATH, TRUE); +- file = g_file_new_for_uri (escaped); ++ file = g_file_new_for_uri (uri); + scheme = g_file_get_uri_scheme (file); + + /* try to launch common schemes for know preferred applications */ + if (scheme != NULL && exo_open_uri_known_category (uri, scheme, &retval)) + { + g_free (scheme); +- g_free (escaped); + return retval; + } + +@@ -356,7 +361,7 @@ + g_debug ("file is directory, use filemanager"); + #endif + /* directories should go fine with a file manager */ +- retval = exo_open_launch_category ("FileManager", escaped); ++ retval = exo_open_launch_category ("FileManager", uri); + succeed = TRUE; + } + else +@@ -382,7 +387,7 @@ + if (executable == NULL + || strcmp (executable, "exo-open") != 0) + { +- fake_list.data = (gpointer) escaped; ++ fake_list.data = (gpointer) uri; + fake_list.prev = fake_list.next = NULL; + + /* launch it */ +@@ -410,7 +415,7 @@ + /* found scheme, open in file manager */ + if (strcmp (scheme, schemes[i]) == 0) + { +- retval = succeed = exo_open_launch_category ("FileManager", escaped); ++ retval = succeed = exo_open_launch_category ("FileManager", uri); + break; + } + } +@@ -429,13 +434,12 @@ + /* try ftp uris if the file manager/gio failed to recognize it */ + if (scheme != NULL + && (strcmp (scheme, "ftp") == 0 || strcmp (scheme, "ftps") == 0)) +- retval = exo_open_launch_category ("WebBrowser", escaped); ++ retval = exo_open_launch_category ("WebBrowser", uri); + else +- retval = gtk_show_uri (NULL, escaped, 0, error); ++ retval = gtk_show_uri (NULL, uri, 0, error); + } + + g_free (scheme); +- g_free (escaped); + + if (!retval && error != NULL) + *error = err; diff --git a/exo.spec b/exo.spec index ada9d43..667ad4b 100644 --- a/exo.spec +++ b/exo.spec @@ -6,7 +6,7 @@ Name: exo Version: 0.10.6 -Release: 3%{?dist} +Release: 4%{?dist} Summary: Application library for the Xfce desktop environment Group: System Environment/Libraries @@ -25,6 +25,10 @@ Source3: http://skvidal.fedorapeople.org/misc/mailtoparse.py Patch1: exo-0.7.2-remove-xfce-category.patch # Set default applications to the ones we use in Fedora Patch2: exo-0.10.2-default-apps.patch +# Escape file uris correctly. +# https://bugzilla.xfce.org/show_bug.cgi?id=12017 +# https://bugzilla.redhat.com/show_bug.cgi?id=1246383 +Patch3: exo-0.10.6-escaped-uri.patch BuildRequires: gtk-doc BuildRequires: gettext @@ -69,6 +73,7 @@ Python libraries and header files for the exo library. %patch1 -p1 %patch2 -p1 +%patch3 -p1 %build %configure --enable-gtk-doc --disable-static @@ -166,6 +171,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %endif %changelog +* Fri Jul 31 2015 Kevin Fenzi 0.10.6-4 +- Add patch to fix %%20's in uris. Fixes bug #1246383 + * Thu Jun 25 2015 Kevin Fenzi 0.10.6-3 - Fix mailtoparse for thunderbird and other cases. Fixes bug #1227021