summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTitanSnow <[email protected]>2017-05-11 07:52:41 +0800
committerTitanSnow <[email protected]>2017-05-11 07:52:41 +0800
commit05590ed02faa985c7b358d4c10126db549e50a77 (patch)
tree0899e01a931f45738cc9f8a9915bcea5907fdef8
parent18cc92064b4331e3d4fb5ca63ef3723b955d4448 (diff)
macos clear_history workaround
-rw-r--r--core/src/xmake/readline/clear_history.c3
1 files changed, 3 insertions, 0 deletions
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