Fix : Check that the file has a protocol.

Reviewers: devilhorns

Subscribers: raster, cedric, zmike

Tags: #enlightenment-git

Differential Revision: https://phab.enlightenment.org/D10410
This commit is contained in:
thierry1970 2020-05-14 11:20:42 +01:00 committed by Carsten Haitzler (Rasterman)
parent 765d8e1d3d
commit 19395ae1fe
1 changed files with 15 additions and 1 deletions

View File

@ -480,6 +480,20 @@ static const Ecore_Getopt options = {
}
};
static Eina_Bool
_is_protocol(const char *path)
{
Eina_Bool nonlocal = EINA_FALSE;
const char *p = path;
while (!nonlocal && *p && *p != '/')
{
nonlocal = (*p == ':');
p++;
}
return nonlocal;
}
E_API int
main(int argc, char *argv[])
{
@ -540,7 +554,7 @@ main(int argc, char *argv[])
}
}
}
else if (strstr(argv[args], ":"))
else if (_is_protocol(argv[args]))
cmds = protocol_open(argv[args]);
else
cmds = local_open(argv[args]);