From ced7a4e2cfc621772abb6f6ad8b4ce2751b6a8b6 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 11 Oct 2017 17:01:40 +1000 Subject: [PATCH] Rework ansi file display in lua --- src/lua_glue.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lua_glue.c b/src/lua_glue.c index 39417b7..7db851e 100644 --- a/src/lua_glue.c +++ b/src/lua_glue.c @@ -44,11 +44,13 @@ int l_bbsRChar(lua_State *L) { int l_bbsDisplayAnsiPause(lua_State *L) { char *str = (char *)lua_tostring(L, -1); char buffer[256]; - - sprintf(buffer, "%s/%s.ans", conf.ansi_path, str); - s_displayansi_pause(buffer, 1); - + if (strchr(str, '/') == NULL) { + sprintf(buffer, "%s/%s.ans", conf.ansi_path, str); + s_displayansi_pause(buffer, 1); + } else { + s_displayansi_pause(str, 1); + } return 0; }