aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-12-18 08:30:27 -0800
committerGuy Harris <guy@alum.mit.edu>2018-12-19 10:22:44 +0000
commit4facf9de20283a2a2f72c9622c05a89396745a09 (patch)
tree7752db2f3501b441a0a7188ab49ecc08f44e9f6a
parentcaea7ea6997c8b91fb880f4bef9a5a466c408054 (diff)
downloadwireshark-4facf9de20283a2a2f72c9622c05a89396745a09.tar.gz
wireshark-4facf9de20283a2a2f72c9622c05a89396745a09.tar.bz2
wireshark-4facf9de20283a2a2f72c9622c05a89396745a09.zip
Lua: Fix compilation with Lua 5.1.
Change-Id: Idd4aa36ee95e985560867094d423128e51aacfb1 Reviewed-on: https://code.wireshark.org/review/31095 Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org> (cherry picked from commit 060811713fa63e04cbed95af4e7720794a1bf3a6) Reviewed-on: https://code.wireshark.org/review/31117 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--epan/wslua/wslua_util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/wslua/wslua_util.c b/epan/wslua/wslua_util.c
index 84c2bdebe0..d6ae0db434 100644
--- a/epan/wslua/wslua_util.c
+++ b/epan/wslua/wslua_util.c
@@ -389,7 +389,12 @@ static int our_loadfilex(lua_State *L, const char *filename, const char *mode) {
}
if (c != EOF)
lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */
+#if LUA_VERSION_NUM >= 502
status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode);
+#else
+ (void) mode; /* Mark unused, similar to Q_UNUSED */
+ status = lua_load(L, getF, &lf, lua_tostring(L, -1));
+#endif
readstatus = ferror(lf.f);
if (filename) fclose(lf.f); /* close file (even in case of errors) */
if (readstatus) {