Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:15.2
moonjit
moonjit105-string_gsub.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File moonjit105-string_gsub.patch of Package moonjit
From cabe3b3cbddc1d3657af451ab0ed82416117cbc7 Mon Sep 17 00:00:00 2001 From: Francois Perrad <francois.perrad@gadz.org> Date: Sun, 26 Jan 2020 14:54:14 +0100 Subject: [PATCH] fix string_gsub 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;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor