diff options
author | 2010-11-23 19:09:21 -0500 | |
---|---|---|
committer | 2010-11-23 19:09:21 -0500 | |
commit | 5f29cb8190dbee6bb10b4eb904c8c39750de352d (patch) | |
tree | ef9d178b4834087d829702d4894ec3b9330f3c0b /src/textadept.c | |
parent | 1f3bbef0357b89f82a65d1e67caa1980eee3f40b (diff) | |
download | textadept-5f29cb8190dbee6bb10b4eb904c8c39750de352d.tar.gz textadept-5f29cb8190dbee6bb10b4eb904c8c39750de352d.zip |
Code cleanup.
Also modified the editing module's enclose() and select_enclosed() functions.
Diffstat (limited to 'src/textadept.c')
-rw-r--r-- | src/textadept.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/textadept.c b/src/textadept.c index ba32e109..9acb50ae 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -1950,7 +1950,7 @@ static int l_cf_gui_dialog(lua_State *lua) { int i, j, k, n = lua_gettop(lua) - 1, argc = n; for (i = 2; i < n + 2; i++) if (lua_type(lua, i) == LUA_TTABLE) argc += lua_objlen(lua, i) - 1; - const char *argv[argc]; + const char **argv = malloc(argc * sizeof(const char *)); for (i = 0, j = 2; j < n + 2; j++) if (lua_type(lua, j) == LUA_TTABLE) { int len = lua_objlen(lua, j); @@ -1963,6 +1963,7 @@ static int l_cf_gui_dialog(lua_State *lua) { char *out = gcocoadialog(type, argc, argv); lua_pushstring(lua, out); free(out); + free(argv); return 1; } |