summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorthierry1970 <thierry@ordissimo.com>2020-05-14 11:20:42 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2020-05-14 11:23:04 +0100
commit19395ae1fe325947b35d32aa63eff7f7bcc79472 (patch)
tree489420a0f86d50216d5112a73516c832f534e02b /src
parent765d8e1d3dd3f8bf3b741772fd8c3a56d024c07f (diff)
Fix : Check that the file has a protocol.
Reviewers: devilhorns Subscribers: raster, cedric, zmike Tags: #enlightenment-git Differential Revision: https://phab.enlightenment.org/D10410
Diffstat (limited to 'src')
-rw-r--r--src/bin/e_open.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/bin/e_open.c b/src/bin/e_open.c
index 602db5a80..3a679fbcb 100644
--- a/src/bin/e_open.c
+++ b/src/bin/e_open.c
@@ -480,6 +480,20 @@ static const Ecore_Getopt options = {
480 } 480 }
481}; 481};
482 482
483static Eina_Bool
484_is_protocol(const char *path)
485{
486 Eina_Bool nonlocal = EINA_FALSE;
487 const char *p = path;
488 while (!nonlocal && *p && *p != '/')
489 {
490 nonlocal = (*p == ':');
491 p++;
492 }
493 return nonlocal;
494}
495
496
483E_API int 497E_API int
484main(int argc, char *argv[]) 498main(int argc, char *argv[])
485{ 499{
@@ -540,7 +554,7 @@ main(int argc, char *argv[])
540 } 554 }
541 } 555 }
542 } 556 }
543 else if (strstr(argv[args], ":")) 557 else if (_is_protocol(argv[args]))
544 cmds = protocol_open(argv[args]); 558 cmds = protocol_open(argv[args]);
545 else 559 else
546 cmds = local_open(argv[args]); 560 cmds = local_open(argv[args]);