summaryrefslogtreecommitdiff
path: root/src/lib/efreet/efreet_desktop_command.c
diff options
context:
space:
mode:
authorthierry1970 <thierry@ordissimo.com>2019-10-28 09:07:12 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-10-28 09:07:13 -0400
commit2f5e2de8c40bc670be7ad0d79346507fdb8ba8a4 (patch)
tree7a715999079cbe875ce1a0d6d17c4eec4e1f38b6 /src/lib/efreet/efreet_desktop_command.c
parent07bca58d6dc4b8f8694216910a92f4abb300cb4e (diff)
efreet : Check that the file has a protocol in efreet_desktop_command_file_process()
if a path has a '/' character in it before the ':' character then it should be treated as a local file which contains a ':' character in its name Reviewers: devilhorns, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10409
Diffstat (limited to '')
-rw-r--r--src/lib/efreet/efreet_desktop_command.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/efreet/efreet_desktop_command.c b/src/lib/efreet/efreet_desktop_command.c
index 26ac9aca2f..6c388caa3f 100644
--- a/src/lib/efreet/efreet_desktop_command.c
+++ b/src/lib/efreet/efreet_desktop_command.c
@@ -605,6 +605,19 @@ efreet_desktop_command_append_icon(char *dest, int *size, int *len,
605 return dest; 605 return dest;
606} 606}
607 607
608static Eina_Bool
609_is_protocol(const char *path)
610{
611 Eina_Bool nonlocal = EINA_FALSE;
612 char *p = (char*)path;
613 while (!nonlocal && *p && *p != '/')
614 {
615 nonlocal = (*p == ':');
616 p++;
617 }
618 return nonlocal;
619}
620
608/** 621/**
609 * @param command the Efreet_Desktop_Comand that this file is for 622 * @param command the Efreet_Desktop_Comand that this file is for
610 * @param file the filname as either an absolute path, relative path, or URI 623 * @param file the filname as either an absolute path, relative path, or URI
@@ -630,7 +643,7 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
630 return NULL; 643 return NULL;
631 } 644 }
632 } 645 }
633 else if (strstr(file, ":")) 646 else if (_is_protocol(file))
634 { 647 {
635 uri = file; 648 uri = file;
636 base = ecore_file_file_get(file); 649 base = ecore_file_file_get(file);