From 05590ed02faa985c7b358d4c10126db549e50a77 Mon Sep 17 00:00:00 2001 From: TitanSnow Date: Thu, 11 May 2017 07:52:41 +0800 Subject: macos clear_history workaround --- core/src/xmake/readline/clear_history.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/xmake/readline/clear_history.c b/core/src/xmake/readline/clear_history.c index 6b79bb8d0..ba6bcc823 100644 --- a/core/src/xmake/readline/clear_history.c +++ b/core/src/xmake/readline/clear_history.c @@ -48,6 +48,9 @@ tb_int_t xm_readline_clear_history(lua_State* lua) // call clear_history (will crash on macOS) #ifndef TB_CONFIG_OS_MACOSX clear_history(); +#else + for (tb_int_t i = history_length - 1; i >= 0; --i) + remove_history(i); #endif // ok -- cgit v1.3.1