summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-04-26 17:41:19 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-04-26 17:41:19 -0300
commitfe8f4c06f1949851eccebf59afbe69f132ab40e8 (patch)
tree7e477a817860d86c56899e4f72bb7c779be4f846
parentc351392940608702bfed0fa0a4c7d035ad31dbce (diff)
downloadlua-github-fe8f4c06f1949851eccebf59afbe69f132ab40e8.tar.gz
detail (better error message for invalid format)
-rw-r--r--lstrlib.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 82ae4ed7..b6eda2cf 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.130 2005/12/29 15:32:11 roberto Exp roberto $
+** $Id: lstrlib.c,v 1.131 2006/04/12 20:13:52 roberto Exp roberto $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -809,7 +809,8 @@ static int str_format (lua_State *L) {
}
}
default: { /* also treat cases `pnLlh' */
- return luaL_error(L, "invalid option to " LUA_QL("format"));
+ return luaL_error(L, "invalid option " LUA_QL("%%%c") " to "
+ LUA_QL("format"), *(strfrmt - 1));
}
}
luaL_addlstring(&b, buff, strlen(buff));