From ad133f208beb70c4dbe1892f112d3ff0c3a39267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Vavru=C5=A1a?= <marek.vavrusa@nic.cz> Date: Fri, 25 Sep 2015 16:26:05 +0200 Subject: [PATCH] daemon/main: fixed missing cmdline input --- daemon/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/daemon/main.c b/daemon/main.c index c7decc30f..bbebdab0b 100644 --- a/daemon/main.c +++ b/daemon/main.c @@ -62,9 +62,11 @@ static void tty_read(uv_stream_t *stream, ssize_t nread, const uv_buf_t *buf) struct engine *engine = stream->data; lua_State *L = engine->L; int ret = engine_cmd(engine, cmd); + const char *message = ""; if (lua_gettop(L) > 0) { - fprintf(ret ? outerr : out, "%s\n> ", lua_tostring(L, -1)); + message = lua_tostring(L, -1); } + fprintf(ret ? outerr : out, "%s\n> ", message); lua_settop(L, 0); free(buf->base); } -- GitLab