aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-26 11:28:19 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-10-26 11:28:19 -0200
commit88f9843eeea82822ef769efca2f937dade277527 (patch)
treed5f518e120048300d8cb1ead8f426f4d37532bc7
parent9b5ae6faf97648fdc304a6fa3c2ae641647cb31a (diff)
downloadlua-88f9843eeea82822ef769efca2f937dade277527.tar.gz
lua-88f9843eeea82822ef769efca2f937dade277527.tar.bz2
lua-88f9843eeea82822ef769efca2f937dade277527.zip
better error message
-rw-r--r--lstrlib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 3a525a73..a105c306 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.125 2005/10/19 13:05:11 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.126 2005/10/23 17:46:30 roberto Exp roberto $
3** Standard library for string operations and pattern-matching 3** Standard library for string operations and pattern-matching
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -639,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
639 lua_pushlstring(L, s, e - s); /* keep original text */ 639 lua_pushlstring(L, s, e - s); /* keep original text */
640 } 640 }
641 else if (!lua_isstring(L, -1)) 641 else if (!lua_isstring(L, -1))
642 luaL_error(L, "invalid replacement value"); 642 luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
643 luaL_addvalue(b); /* add result to accumulator */ 643 luaL_addvalue(b); /* add result to accumulator */
644} 644}
645 645