python-pathvalidate: bump version to 0.14.1
[buildroot-gz.git] / package / lua / 5.1.5 / 0011-linenoise.patch
blob488c080a1ea6f6dac36a79b7ed1123392ec75cb6
1 Add support of linenoise (replace readline)
3 see discussion, http://lua-users.org/lists/lua-l/2010-03/msg00879.html
5 Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
7 Index: b/src/luaconf.h
8 ===================================================================
9 --- a/src/luaconf.h
10 +++ b/src/luaconf.h
11 @@ -279,6 +279,13 @@
12 if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
13 add_history(lua_tostring(L, idx)); /* add it to history */
14 #define lua_freeline(L,b) ((void)L, free(b))
15 +#elif defined(LUA_USE_LINENOISE)
16 +#include <linenoise.h>
17 +#define lua_readline(L,b,p) ((void)L, ((b)=linenoise(p)) != NULL)
18 +#define lua_saveline(L,idx) \
19 + if (lua_strlen(L,idx) > 0) /* non-empty line? */ \
20 + linenoiseHistoryAdd(lua_tostring(L, idx)); /* add it to history */
21 +#define lua_freeline(L,b) ((void)L, free(b))
22 #else
23 #define lua_readline(L,b,p) \
24 ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \