commit 88f9843eeea82822ef769efca2f937dade277527
parent 9b5ae6faf97648fdc304a6fa3c2ae641647cb31a
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Wed, 26 Oct 2005 11:27:57 -0200
better error message
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lstrlib.c b/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.125 2005/10/19 13:05:11 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.126 2005/10/23 17:46:30 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -639,7 +639,7 @@ static void add_value (MatchState *ms, luaL_Buffer *b, const char *s,
lua_pushlstring(L, s, e - s); /* keep original text */
}
else if (!lua_isstring(L, -1))
- luaL_error(L, "invalid replacement value");
+ luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1));
luaL_addvalue(b); /* add result to accumulator */
}