summaryrefslogtreecommitdiff
path: root/core/src/xmake
diff options
context:
space:
mode:
authorruki <[email protected]>2017-05-11 08:46:59 +0800
committerruki <[email protected]>2017-05-11 08:46:59 +0800
commit7ea12ad1534f745994b4c3b8eaf0820b68bb1907 (patch)
tree21ad341523ecac3059b4481aad399b4d6d347e20 /core/src/xmake
parentabf45462b78f7f483e41fecf37593e718643a420 (diff)
adjust macro position for clear_history
Diffstat (limited to 'core/src/xmake')
-rw-r--r--core/src/xmake/readline/clear_history.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/src/xmake/readline/clear_history.c b/core/src/xmake/readline/clear_history.c
index ba6bcc823..031d47b76 100644
--- a/core/src/xmake/readline/clear_history.c
+++ b/core/src/xmake/readline/clear_history.c
@@ -45,12 +45,12 @@ tb_int_t xm_readline_clear_history(lua_State* lua)
// check
tb_assert_and_check_return_val(lua, 0);
+#ifdef TB_CONFIG_OS_MACOSX
// 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);
+#else
+ clear_history();
#endif
// ok