equal
deleted
inserted
replaced
634 if (!lua_toboolean(L, -1)) { /* nil or false? */ |
634 if (!lua_toboolean(L, -1)) { /* nil or false? */ |
635 lua_pop(L, 1); |
635 lua_pop(L, 1); |
636 lua_pushlstring(L, s, e - s); /* keep original text */ |
636 lua_pushlstring(L, s, e - s); /* keep original text */ |
637 } |
637 } |
638 else if (!lua_isstring(L, -1)) |
638 else if (!lua_isstring(L, -1)) |
639 luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); |
639 luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); |
640 luaL_addvalue(b); /* add result to accumulator */ |
640 luaL_addvalue(b); /* add result to accumulator */ |
641 } |
641 } |
642 |
642 |
643 |
643 |
644 static int str_gsub (lua_State *L) { |
644 static int str_gsub (lua_State *L) { |