misc/liblua/lstrlib.c
changeset 3697 d5b30d6373fc
parent 2812 0a24853de796
child 10017 de822cd3df3a
equal deleted inserted replaced
3695:c11abf387a7d 3697:d5b30d6373fc
   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) {