Efreet desktop: Fixed URI creation when opening files.
authortasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 4 Apr 2011 13:43:01 +0000 (13:43 +0000)
committertasn <tasn@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 4 Apr 2011 13:43:01 +0000 (13:43 +0000)
URI should be escaped before passed to the application being
executed. This fixes runnig videos with vlc from paths with
utf8 values in them.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/efreet@58329 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/efreet_desktop_command.c

index 8174c0a..658132c 100644 (file)
@@ -716,9 +716,16 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
 
         if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
         {
-            char buf[PATH_MAX];
-            snprintf(buf, sizeof(buf), "file://%s", absol);
+            const char *buf;
+            Efreet_Uri ef_uri;
+            ef_uri.protocol = "file";
+            ef_uri.hostname = "";
+            ef_uri.path = absol;
+            buf = efreet_uri_encode(&ef_uri);
+
             f->uri = strdup(buf);
+
+            eina_stringshare_del(buf);
         }
 
         free(absol);