]> spindle.queued.net Git - midori/commitdiff
Check if filename to open is a filename or not
authorChristian Dywan <christian@twotoasts.de>
Thu, 17 Feb 2011 18:38:49 +0000 (19:38 +0100)
committerChristian Dywan <christian@twotoasts.de>
Thu, 17 Feb 2011 18:54:35 +0000 (19:54 +0100)
Fixes: https://bugs.launchpad.net/midori/+bug/715118
midori/sokoke.c

index b772bab533da4db5830e56f217867392dff1e483..3eb59323a47aa9c6e3f524cc2a0e9d29e1ce0362 100644 (file)
@@ -401,7 +401,10 @@ sokoke_show_uri (GdkScreen*   screen,
         GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
         GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL);
     box = gtk_dialog_get_content_area (GTK_DIALOG (dialog));
-    filename = g_filename_from_uri (uri, NULL, NULL);
+    if (g_str_has_prefix (uri, "file:///"))
+        filename = g_filename_from_uri (uri, NULL, NULL);
+    else
+        filename = g_strdup (uri);
     ms = g_strdup_printf (_("Choose an application or command to open \"%s\":"),
                           filename);
     gtk_box_pack_start (GTK_BOX (box), gtk_label_new (ms), TRUE, FALSE, 4);