ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=c37c23068cbd00d0d3fccb7f5ebca53ad7ea8c1f

commit c37c23068cbd00d0d3fccb7f5ebca53ad7ea8c1f
Author: Andy Williams <a...@andywilliams.me>
Date:   Sat May 13 23:29:46 2017 +0100

    cmdline: don't try to open unknown file types
    
    Display a warning and exit - fixes T5480
    @fix
---
 src/bin/edi_main.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c
index 3449b44..38a05d8 100644
--- a/src/bin/edi_main.c
+++ b/src/bin/edi_main.c
@@ -22,6 +22,7 @@
 #include "edi_consolepanel.h"
 #include "edi_searchpanel.h"
 #include "edi_debugpanel.h"
+#include "edi_content_provider.h"
 #include "mainview/edi_mainview.h"
 #include "screens/edi_screens.h"
 
@@ -1360,7 +1361,7 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
    args = ecore_getopt_parse(&optdesc, values, argc, argv);
    if (args < 0)
      {
-        EINA_LOG_CRIT("Could not parse arguments.");
+        CRIT("Could not parse arguments.");
         goto end;
      }
    else if (quit_option)
@@ -1392,6 +1393,14 @@ elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED)
      }
    else if (!ecore_file_is_dir(project_path))
      {
+        const char *mime;
+
+        mime = efreet_mime_type_get(project_path);
+        if (!edi_content_provider_for_mime_get(mime))
+          {
+             fprintf(stderr, "Could not open file of unsupported mime type 
(%s)\n", mime);
+             goto end;
+          }
         edi_open_file(project_path);
      }
    else if (!(edi_open(project_path)))

-- 


Reply via email to