lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 62790ab15d7fdb4ffa2b018196194d2132da3799
parent ad60b3ead799fe77f5bcb378a58410835b79d596
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  9 Nov 2007 16:54:44 -0200

detail

Diffstat:
Mlstring.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lstring.c b/lstring.c @@ -1,5 +1,5 @@ /* -** $Id: lstring.c,v 2.8 2005/12/22 16:19:56 roberto Exp roberto $ +** $Id: lstring.c,v 2.9 2006/07/11 15:53:29 roberto Exp roberto $ ** String table (keeps all strings handled by Lua) ** See Copyright Notice in lua.h */ @@ -82,7 +82,8 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { o != NULL; o = o->gch.next) { TString *ts = rawgco2ts(o); - if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { + if (h == ts->tsv.hash && ts->tsv.len == l && + (memcmp(str, getstr(ts), l) == 0)) { /* string may be dead */ if (isdead(G(L), o)) changewhite(o); return ts;