MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaL_addgsub

Function luaL_addgsub

third-party/lua-5.5.0/src/lauxlib.c:1026–1036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1024
1025
1026LUALIB_API void luaL_addgsub (luaL_Buffer *b, const char *s,
1027 const char *p, const char *r) {
1028 const char *wild;
1029 size_t l = strlen(p);
1030 while ((wild = strstr(s, p)) != NULL) {
1031 luaL_addlstring(b, s, ct_diff2sz(wild - s)); /* push prefix */
1032 luaL_addstring(b, r); /* push replacement in place of pattern */
1033 s = wild + l; /* continue after 'p' */
1034 }
1035 luaL_addstring(b, s); /* push last suffix */
1036}
1037
1038
1039LUALIB_API const char *luaL_gsub (lua_State *L, const char *s,

Callers 3

luaL_gsubFunction · 0.70
pusherrornotfoundFunction · 0.70
searchpathFunction · 0.70

Calls 2

luaL_addlstringFunction · 0.70
luaL_addstringFunction · 0.70

Tested by

no test coverage detected