aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorthibault.ferrante <thibault.ferrante@gmail.com>2020-08-03 14:37:28 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-08-03 13:27:19 +0000
commit89c5bef0a84aa401302b82ad77bd782c059f8377 (patch)
tree02a3207af95137ccc85cf2930863a19ac5a5eef8
parent53cb639629337ea5cd20eeb70a0f88766bf7a1f5 (diff)
downloadaports-89c5bef0a84aa401302b82ad77bd782c059f8377.tar.gz
aports-89c5bef0a84aa401302b82ad77bd782c059f8377.tar.bz2
aports-89c5bef0a84aa401302b82ad77bd782c059f8377.tar.xz
main/luajit: fix gsub issue
See https://github.com/moonjit/moonjit/issues/86
-rw-r--r--main/luajit/20-src-lib_string.patch30
-rw-r--r--main/luajit/APKBUILD8
2 files changed, 35 insertions, 3 deletions
diff --git a/main/luajit/20-src-lib_string.patch b/main/luajit/20-src-lib_string.patch
new file mode 100644
index 0000000000..f04d83b417
--- /dev/null
+++ b/main/luajit/20-src-lib_string.patch
@@ -0,0 +1,30 @@
+see https://github.com/moonjit/moonjit/issues/86
+
+Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
+---
+ src/lib_string.c | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/lib_string.c b/src/lib_string.c
+index 5e2891a9e..a90e189ba 100644
+--- a/src/lib_string.c
++++ b/src/lib_string.c
+@@ -621,7 +621,7 @@ LJLIB_CF(string_gsub)
+ const char *p = luaL_checklstring(L, 2, &lp);
+ int tr = lua_type(L, 3);
+ int max_s = luaL_optint(L, 4, (int)(srcl+1));
+- int anchor = (*p == '^') ? (p++, 1) : 0;
++ int anchor = (*p == '^');
+ int n = 0;
+ MatchState ms;
+ luaL_Buffer b;
+@@ -629,6 +629,9 @@ LJLIB_CF(string_gsub)
+ tr == LUA_TFUNCTION || tr == LUA_TTABLE))
+ lj_err_arg(L, 3, LJ_ERR_NOSFT);
+ luaL_buffinit(L, &b);
++ if (anchor) {
++ p++; lp--; /* skip anchor character */
++ }
+ ms.L = L;
+ ms.src_init = src;
+ ms.src_end = src+srcl;
diff --git a/main/luajit/APKBUILD b/main/luajit/APKBUILD
index ca329c4593..9cf0502d1a 100644
--- a/main/luajit/APKBUILD
+++ b/main/luajit/APKBUILD
@@ -3,7 +3,7 @@
pkgname=luajit
_pkgname=moonjit
pkgver=2.2.0
-pkgrel=1
+pkgrel=2
pkgdesc="Integration fork of the original LuaJIT"
url="https://github.com/moonjit/moonjit"
arch="all"
@@ -11,7 +11,8 @@ license="MIT"
provides="lua"
subpackages="$pkgname-dev $pkgname-doc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/moonjit/moonjit/archive/$pkgver.tar.gz
- 10-module-paths.patch"
+ 10-module-paths.patch
+ 20-src-lib_string.patch"
builddir="$srcdir/$_pkgname-$pkgver"
build() {
@@ -41,4 +42,5 @@ package() {
}
sha512sums="a940dd9973801f7067e376d62ec70ab5fbf635f59c648dcb45072f55290a6752abb3b1fa307bdd81d4bf05c719338e8fbda143f62861c61cb66b34cc9e8e7d54 moonjit-2.2.0.tar.gz
-9c6c410e142838c5128c70570e66beb53cc5422df5ecfb8ab0b5f362637b21ab5978c00f19bc1759165df162fd6438a2ed43e25020400011b7bb14014d87c62e 10-module-paths.patch"
+9c6c410e142838c5128c70570e66beb53cc5422df5ecfb8ab0b5f362637b21ab5978c00f19bc1759165df162fd6438a2ed43e25020400011b7bb14014d87c62e 10-module-paths.patch
+9d87e944580fe7a3c24e043012dbdacf5141bafb5ea83dc141c42f6641b8df117d1779c3c50ee9fccc58e625a0bc04c64dd75ab0c1815bbbf2a2e645ec0ff85e 20-src-lib_string.patch"