about summary refs log tree commit diff stats
path: root/src/lua.c
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2021-11-11 16:09:46 -0800
committerKartik K. Agaram <vc@akkartik.com>2021-11-11 16:09:46 -0800
commit15e0ac70f95ac5123c52b9d5dcae02bd812984cd (patch)
treebaf59340f49bd70cb9a68f02ccc046e6a5fb7013 /src/lua.c
parent3e7ff252af32b2bd481d045f4b732acbdbe1b612 (diff)
downloadteliva-15e0ac70f95ac5123c52b9d5dcae02bd812984cd.tar.gz
.
Diffstat (limited to 'src/lua.c')
-rw-r--r--src/lua.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lua.c b/src/lua.c
index 7da0f02..a0ca094 100644
--- a/src/lua.c
+++ b/src/lua.c
@@ -337,6 +337,7 @@ void editString(lua_State *L, char *name) {
     teliva_get_definition(L, name);
 //?     stackDump(L);
     const char *contents = lua_tostring(L, -1);
+    lua_pop(L, 1);
     int outfd = open("teliva_editbuffer", O_WRONLY|O_CREAT|O_TRUNC, 0644);
     write(outfd, contents, strlen(contents));
     close(outfd);
@@ -351,7 +352,6 @@ void editString(lua_State *L, char *name) {
     close(infd);
 
     /* save contents back into image */
-    lua_pop(L, 1);
     lua_pushstring(L, new_contents);
     lua_setfield(L, -2, name);