summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2019-09-04 20:09:41 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-09-04 20:09:44 +0100
commit8dcd638829ce0089f969bd7f6914683cb747b624 (patch)
tree25d3e567df65534ea91465f0590d1f00119950cb /src/lib
parentd794a0d3d95c3addcb21df75606c444c6e3ed6d8 (diff)
Efreet_Uri: fix URI decoding when a Windows path (letter followed by :) is passed to efreet_uri_decode()
Summary: uri decoding returned a wrong URI when a Windows path is given Test Plan: rage, which is using efreet_uri is now playing files on Windows Reviewers: raster, cedric, zmike, stefan_schmidt Reviewed By: raster Subscribers: stefan_schmidt, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9839
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efreet/efreet_uri.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/efreet/efreet_uri.c b/src/lib/efreet/efreet_uri.c
index 9f468ce5df..44fe54a35f 100644
--- a/src/lib/efreet/efreet_uri.c
+++ b/src/lib/efreet/efreet_uri.c
@@ -22,13 +22,16 @@ efreet_uri_decode(const char *full_uri)
22 Efreet_Uri *uri; 22 Efreet_Uri *uri;
23 const char *p; 23 const char *p;
24 char scheme[64], authority[_POSIX_HOST_NAME_MAX], path[PATH_MAX]; 24 char scheme[64], authority[_POSIX_HOST_NAME_MAX], path[PATH_MAX];
25 char *sep;
25 int i = 0; 26 int i = 0;
26 27
27 EINA_SAFETY_ON_NULL_RETURN_VAL(full_uri, NULL); 28 EINA_SAFETY_ON_NULL_RETURN_VAL(full_uri, NULL);
28 29
29 /* An uri should be in the form <scheme>:[<authority>][<path>][<query>][<fragment>] */ 30 /* An uri should be in the form <scheme>:[<authority>][<path>][<query>][<fragment>] */
30 if (!strstr(full_uri, ":")) return NULL; 31 sep = strchr(full_uri, ':');
31 32 if (!sep) return NULL;
33 /* check if we have a Windows PATH, that is a letter follow by a colon */
34 if ((sep - full_uri) == 1) return NULL;
32 35
33 memset(scheme, 0, 64); 36 memset(scheme, 0, 64);
34 memset(authority, 0, _POSIX_HOST_NAME_MAX); 37 memset(authority, 0, _POSIX_HOST_NAME_MAX);