diff options
author | 2008-09-21 22:16:18 -0400 | |
---|---|---|
committer | 2008-09-21 22:16:18 -0400 | |
commit | f093965dfc07935323b8a9244a591d84788b497c (patch) | |
tree | 37e9be66f26d79f95f286566fc3ceb7b6b398620 /src/textadept.c | |
parent | fdb720e8d0b5adf4fd9269ee9e4381dc0aebdb39 (diff) | |
download | textadept-f093965dfc07935323b8a9244a591d84788b497c.tar.gz textadept-f093965dfc07935323b8a9244a591d84788b497c.zip |
Textadept gracefully exits when errors occur in core/init.lua.
Originally the error message was displayed in Textadept, but any attempts to
close the program would fail because core/init.lua wasn't properly loaded.
Errors from 'l_load_script' are displayed in a dialog box now.
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/src/textadept.c b/src/textadept.c index 4d639ab6..9aaeccd6 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -2,11 +2,6 @@ #include "textadept.h" -#ifdef WIN32 -#include "Windows.h" -#define strcasecmp _stricmp -#endif - #define gbool gboolean #define signal(o, s, c) g_signal_connect(G_OBJECT(o), s, G_CALLBACK(c), 0) @@ -71,11 +66,13 @@ static void button_clicked(GtkWidget *button, gpointer); */ int main(int argc, char **argv) { gtk_init(&argc, &argv); - l_init(argc, argv, false); - create_ui(); - l_load_script("init.lua"); - gtk_main(); - return 0; + if (l_init(argc, argv, false)) { + create_ui(); + l_load_script("init.lua"); + gtk_main(); + return 0; + } else if (lua) lua_close(lua); + return 1; } #ifdef WIN32 |