Showing the changes to src/lstring.c (1 of 11 files). Show all
Unified · Split
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstring.c,v 1.45 2000/10/30 17:49:19 roberto Exp $ | 2 | ** $Id: lstring.c,v 1.45a 2000/10/30 17:49:19 roberto Exp $ |
| 3 | ** String table (keeps all strings handled by Lua) | 3 | ** String table (keeps all strings handled by Lua) |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -119,7 +119,7 @@ TString *luaS_newudata (lua_State *L, size_t s, void *udata) { · 113 unmodified lines | |||
| 119 | ts->nexthash = NULL; | 119 | ts->nexthash = NULL; |
| 120 | ts->len = s; | 120 | ts->len = s; |
| 121 | ts->u.d.tag = 0; | 121 | ts->u.d.tag = 0; |
| 122 | ts->u.d.value = (udata == NULL) ? uts+1 : udata; | 122 | ts->u.d.value = (s > 0) ? uts+1 : udata; |
| 123 | L->nblocks += sizestring(s); | 123 | L->nblocks += sizestring(s); |
| 124 | /* insert it on table */ | 124 | /* insert it on table */ |
| 125 | newentry(L, &L->udt, ts, IntPoint(ts->u.d.value) & (L->udt.size-1)); | 125 | newentry(L, &L->udt, ts, IntPoint(ts->u.d.value) & (L->udt.size-1)); |