ajwillia-ms pushed a commit to branch edi-0.5. http://git.enlightenment.org/tools/edi.git/commit/?id=460c7008e420a449fb79b095322e2130a0f320e1
commit 460c7008e420a449fb79b095322e2130a0f320e1 Author: Andy Williams <[email protected]> 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 a94ef40..607752c 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -21,6 +21,7 @@ #include "edi_logpanel.h" #include "edi_consolepanel.h" #include "edi_searchpanel.h" +#include "edi_content_provider.h" #include "mainview/edi_mainview.h" #include "screens/edi_screens.h" @@ -1316,7 +1317,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) @@ -1348,6 +1349,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))) --
