forked from enlightenment/efl
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
This commit is contained in:
parent
d794a0d3d9
commit
8dcd638829
|
@ -22,13 +22,16 @@ efreet_uri_decode(const char *full_uri)
|
|||
Efreet_Uri *uri;
|
||||
const char *p;
|
||||
char scheme[64], authority[_POSIX_HOST_NAME_MAX], path[PATH_MAX];
|
||||
char *sep;
|
||||
int i = 0;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(full_uri, NULL);
|
||||
|
||||
/* An uri should be in the form <scheme>:[<authority>][<path>][<query>][<fragment>] */
|
||||
if (!strstr(full_uri, ":")) return NULL;
|
||||
|
||||
sep = strchr(full_uri, ':');
|
||||
if (!sep) return NULL;
|
||||
/* check if we have a Windows PATH, that is a letter follow by a colon */
|
||||
if ((sep - full_uri) == 1) return NULL;
|
||||
|
||||
memset(scheme, 0, 64);
|
||||
memset(authority, 0, _POSIX_HOST_NAME_MAX);
|
||||
|
|
Loading…
Reference in New Issue