better quotes for strings in error messages

This commit is contained in:
Roberto Ierusalimschy
2005-05-16 18:19:00 -03:00
parent da32450c3d
commit c2bb9abcec
16 changed files with 85 additions and 78 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: lbaselib.c,v 1.173 2005/03/28 17:17:53 roberto Exp roberto $
** $Id: lbaselib.c,v 1.174 2005/05/16 19:21:11 roberto Exp roberto $
** Basic library
** See Copyright Notice in lua.h
*/
@@ -39,7 +39,8 @@ static int luaB_print (lua_State *L) {
lua_call(L, 1, 1);
s = lua_tostring(L, -1); /* get result */
if (s == NULL)
return luaL_error(L, "`tostring' must return a string to `print'");
return luaL_error(L, LUA_SM " must return a string to " LUA_SM,
"tostring", "print");
if (i>1) fputs("\t", stdout);
fputs(s, stdout);
lua_pop(L, 1); /* pop result */
@@ -148,7 +149,8 @@ static int luaB_setfenv (lua_State *L) {
return 0;
}
else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0)
luaL_error(L, "`setfenv' cannot change environment of given object");
luaL_error(L, LUA_SM " cannot change environment of given object",
"setfenv");
return 1;
}