From c37c23068cbd00d0d3fccb7f5ebca53ad7ea8c1f Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Sat, 13 May 2017 23:29:46 +0100 Subject: [PATCH] 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)))