Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 896150 Details for
Bug 1098392
Lua unsupported since lua50 no longer in repository
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Adds lua>51 support
elinks-0.12pre6-lua51.patch (text/plain), 3.62 KB, created by
Martin Miller
on 2014-05-16 04:10:13 UTC
(
hide
)
Description:
Adds lua>51 support
Filename:
MIME Type:
Creator:
Martin Miller
Created:
2014-05-16 04:10:13 UTC
Size:
3.62 KB
patch
obsolete
>diff --git a/configure.in b/configure.in >index 4290e45..70b311a 100644 >--- a/configure.in >+++ b/configure.in >@@ -854,10 +854,10 @@ if test -z "$disable_lua"; then > withval=""; > fi > for luadir in "$withval" "" /usr /usr/local; do >- for suffix in "" 50; do >+ for suffix in "" 5.1 51; do > if test "$cf_result" = no && ( test -f "$luadir/include/lua.h" || \ > test -f "$luadir/include/lua$suffix/lua.h" ) ; then >- LUA_LIBS="-L$luadir/lib -llua$suffix -llualib$suffix -lm" >+ LUA_LIBS="-L$luadir/lib -llua$suffix -lm" > LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix" > > LIBS="$LUA_LIBS $LIBS_X" >@@ -865,15 +865,13 @@ if test -z "$disable_lua"; then > CPPFLAGS="$CPPFLAGS_X $LUA_CFLAGS" > > # Check that it is a compatible Lua version >- AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include <lua.h> >- #include <lualib.h>]], [[ lua_State *L = lua_open(); >- luaopen_base(L); >- luaopen_table(L); >- luaopen_io(L); >- luaopen_string(L); >- luaopen_math(L); >- lua_pushboolean(L, 1); >- lua_close(L);]])],[cf_result=yes],[cf_result=no]) >+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <lauxlib.h>] >+ #include <lua.h> >+ #include <lualib.h> >+ ], [[ lua_State *L = luaL_newstate(); >+ luaL_openlibs(L); >+ lua_pushboolean(L, 1); >+ lua_close(L);]])],[cf_result=yes],[cf_result=no]) > fi > done > done >diff --git a/src/scripting/lua/core.c b/src/scripting/lua/core.c >index bff037b..00303f9 100644 >--- a/src/scripting/lua/core.c >+++ b/src/scripting/lua/core.c >@@ -12,6 +12,7 @@ > #include <unistd.h> > #endif > >+#include <lauxlib.h> > #include <lua.h> > #include <lualib.h> > >@@ -369,6 +370,7 @@ l_edit_bookmark_dialog(LS) > > if (!lua_isstring(S, 1) || !lua_isstring(S, 2) > || !lua_isstring(S, 3) || !lua_isfunction(S, 4)) { >+ alert_lua_error("bad arguments to edit_bookmark_dialog"); > lua_pushnil(S); > return 1; > } >@@ -658,7 +660,7 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char *filename) > if (file_can_read(file)) { > int oldtop = lua_gettop(S); > >- if (lua_dofile(S, file) != 0) >+ if (luaL_dofile(S, file) != 0) > sleep(3); /* Let some time to see error messages. */ > lua_settop(S, oldtop); > } >@@ -669,13 +671,9 @@ do_hooks_file(LS, unsigned char *prefix, unsigned char *filename) > void > init_lua(struct module *module) > { >- L = lua_open(); >+ L = luaL_newstate(); > >- luaopen_base(L); >- luaopen_table(L); >- luaopen_io(L); >- luaopen_string(L); >- luaopen_math(L); >+ luaL_openlibs(L); > > lua_register(L, LUA_ALERT, l_alert); > lua_register(L, "current_url", l_current_url); >@@ -780,7 +778,7 @@ handle_ret_eval(struct session *ses) > int oldtop = lua_gettop(L); > > if (prepare_lua(ses) == 0) { >- lua_dostring(L, expr); >+ (void)luaL_dostring(L, expr); > lua_settop(L, oldtop); > finish_lua(); > } >diff --git a/src/scripting/lua/hooks.c b/src/scripting/lua/hooks.c >index d79ad80..4fab122 100644 >--- a/src/scripting/lua/hooks.c >+++ b/src/scripting/lua/hooks.c >@@ -15,6 +15,9 @@ > #include "session/session.h" > #include "util/string.h" > >+#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM >= 501 >+#define ELINKS_LUA_51 >+#endif > > /* The events that will trigger the functions below and what they are expected > * to do is explained in doc/events.txt */ >@@ -200,7 +203,11 @@ static enum evhook_status > script_hook_quit(va_list ap, void *data) > { > if (!prepare_lua(NULL)) { >+#ifdef ELINKS_LUA_51 >+ if (luaL_dostring(lua_state, "if quit_hook then quit_hook() end")); >+#else > lua_dostring(lua_state, "if quit_hook then quit_hook() end"); >+#endif > finish_lua(); > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1098392
: 896150 |
896162