raster pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=19395ae1fe325947b35d32aa63eff7f7bcc79472

commit 19395ae1fe325947b35d32aa63eff7f7bcc79472
Author: thierry1970 <[email protected]>
Date:   Thu May 14 11:20:42 2020 +0100

    Fix : Check that the file has a protocol.
    
    Reviewers: devilhorns
    
    Subscribers: raster, cedric, zmike
    
    Tags: #enlightenment-git
    
    Differential Revision: https://phab.enlightenment.org/D10410
---
 src/bin/e_open.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

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 = {
    }
 };
 
+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]);

-- 


Reply via email to