aboutsummaryrefslogtreecommitdiff
path: root/lstring.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-11-09 16:55:07 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2007-11-09 16:55:07 -0200
commit62790ab15d7fdb4ffa2b018196194d2132da3799 (patch)
treed862219659c15e6a6be6ad4681102f3e956e7085 /lstring.c
parentad60b3ead799fe77f5bcb378a58410835b79d596 (diff)
downloadlua-62790ab15d7fdb4ffa2b018196194d2132da3799.tar.gz
lua-62790ab15d7fdb4ffa2b018196194d2132da3799.tar.bz2
lua-62790ab15d7fdb4ffa2b018196194d2132da3799.zip
detail
Diffstat (limited to 'lstring.c')
-rw-r--r--lstring.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lstring.c b/lstring.c
index dc1a780d..f8f0debc 100644
--- a/lstring.c
+++ b/lstring.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstring.c,v 2.8 2005/12/22 16:19:56 roberto Exp roberto $ 2** $Id: lstring.c,v 2.9 2006/07/11 15:53:29 roberto Exp roberto $
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*/
@@ -82,7 +82,8 @@ TString *luaS_newlstr (lua_State *L, const char *str, size_t l) {
82 o != NULL; 82 o != NULL;
83 o = o->gch.next) { 83 o = o->gch.next) {
84 TString *ts = rawgco2ts(o); 84 TString *ts = rawgco2ts(o);
85 if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { 85 if (h == ts->tsv.hash && ts->tsv.len == l &&
86 (memcmp(str, getstr(ts), l) == 0)) {
86 /* string may be dead */ 87 /* string may be dead */
87 if (isdead(G(L), o)) changewhite(o); 88 if (isdead(G(L), o)) changewhite(o);
88 return ts; 89 return ts;