aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormitchell <70453897+667e-11@users.noreply.github.com>2010-12-28 21:16:29 -0500
committermitchell <70453897+667e-11@users.noreply.github.com>2010-12-28 21:16:29 -0500
commitb4a6d0a685c7f1eb7f180de086bcb336b0bfb343 (patch)
treee280b315b777bc3acfd9c43c303ae67a3dbd15a0 /src
parent239343c9aec7104d2635e5c810987d2cab8ce912 (diff)
downloadtextadept-b4a6d0a685c7f1eb7f180de086bcb336b0bfb343.tar.gz
textadept-b4a6d0a685c7f1eb7f180de086bcb336b0bfb343.zip
Fixed gui.statusbar_text bug; src/textadept.c
Diffstat (limited to 'src')
-rw-r--r--src/textadept.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/textadept.c b/src/textadept.c
index 3fbf46d7..58ede1a6 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -93,7 +93,7 @@ static gbool c_keypress(GtkWidget *, GdkEventKey *, gpointer);
// Lua
lua_State *lua;
int closing = FALSE;
-const char *statusbar_text = "";
+char *statusbar_text = 0;
static int tVOID = 0, tINT = 1, tLENGTH = 2, /*tPOSITION = 3, tCOLOUR = 4,*/
tBOOL = 5, tKEYMOD = 6, tSTRING = 7, tSTRINGRESULT = 8;
@@ -1736,7 +1736,8 @@ static int l_gui_mt_newindex(lua_State *lua) {
else if (streq(key, "docstatusbar_text"))
set_statusbar_text(lua_tostring(lua, 3), 1);
else if (streq(key, "statusbar_text")) {
- statusbar_text = !lua_isnil(lua, 3) ? lua_tostring(lua, 3) : "";
+ g_free(statusbar_text);
+ statusbar_text = g_strdup(!lua_isnil(lua, 3) ? lua_tostring(lua, 3) : "");
set_statusbar_text(statusbar_text, 0);
} else if (streq(key, "menubar")) {
luaL_argcheck(lua, lua_istable(lua, 3), 3, "table of menus expected");