summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2017-09-03 21:13:09 +1000
committerdaurnimator <quae@daurnimator.com>2017-09-03 21:16:31 +1000
commitdbe9317aed79bb65f16e5cb680971760dbe5f6a6 (patch)
treec1bcba62c19ed0e737fdfcbdcace8fa4c728e80b /src
parent40e76e4283e69c13da9cf6cdf4290036e3c247d7 (diff)
downloadluaossl-dbe9317aed79bb65f16e5cb680971760dbe5f6a6.tar.gz
luaossl-dbe9317aed79bb65f16e5cb680971760dbe5f6a6.tar.bz2
luaossl-dbe9317aed79bb65f16e5cb680971760dbe5f6a6.zip
Don't reset metamethods when reset is 0
Fixes issue where interposed methods were discarded if any more C modules were loaded Closes #104
Diffstat (limited to 'src')
-rw-r--r--src/openssl.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/openssl.c b/src/openssl.c
index 5507762..f0d2a38 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -1191,6 +1191,9 @@ static _Bool auxL_newclass(lua_State *L, const char *name, const auxL_Reg *metho
1191 _Bool fresh = auxL_newmetatable(L, name, reset); 1191 _Bool fresh = auxL_newmetatable(L, name, reset);
1192 int n; 1192 int n;
1193 1193
1194 if (!reset && !fresh)
1195 return fresh;
1196
1194 auxL_setfuncs(L, metamethods, 0); 1197 auxL_setfuncs(L, metamethods, 0);
1195 1198
1196 if ((n = auxL_liblen(methods))) { 1199 if ((n = auxL_liblen(methods))) {