MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / luaL_addgsub

Function luaL_addgsub

3rd/lua-5.4.3/src/lauxlib.c:987–997  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

985
986
987LUALIB_API void luaL_addgsub (luaL_Buffer *b, const char *s,
988 const char *p, const char *r) {
989 const char *wild;
990 size_t l = strlen(p);
991 while ((wild = strstr(s, p)) != NULL) {
992 luaL_addlstring(b, s, wild - s); /* push prefix */
993 luaL_addstring(b, r); /* push replacement in place of pattern */
994 s = wild + l; /* continue after 'p' */
995 }
996 luaL_addstring(b, s); /* push last suffix */
997}
998
999
1000LUALIB_API const char *luaL_gsub (lua_State *L, const char *s,

Callers 3

luaL_gsubFunction · 0.85
pusherrornotfoundFunction · 0.85
searchpathFunction · 0.85

Calls 2

luaL_addlstringFunction · 0.85
luaL_addstringFunction · 0.85

Tested by

no test coverage detected