Commit 9b76d60b authored by Sergey Lyubka's avatar Sergey Lyubka

Merge pull request #131 from abadc0de/lua_read_fixup

lsp_mg_read: remove dead code, return nil on empty read
parents 63ccf819 ce55924a
...@@ -4104,7 +4104,7 @@ static int lsp_mg_read(lua_State *L) { ...@@ -4104,7 +4104,7 @@ static int lsp_mg_read(lua_State *L) {
char buf[1024]; char buf[1024];
int len = mg_read(conn, buf, sizeof(buf)); int len = mg_read(conn, buf, sizeof(buf));
lua_settop(L, 0); if (!len) return 0;
lua_pushlstring(L, buf, len); lua_pushlstring(L, buf, len);
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment