From 67578ec51f1a3ec2c967f15d370067caf9e0b87b Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 17 May 2005 16:49:15 -0300 Subject: several small details --- lstrlib.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index fd898ce3..5080caba 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.113 2005/05/16 19:21:11 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.114 2005/05/16 21:19:00 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -200,14 +200,14 @@ static const char *classend (MatchState *ms, const char *p) { switch (*p++) { case L_ESC: { if (*p == '\0') - luaL_error(ms->L, "malformed pattern (ends with '%%')"); + luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); return p+1; } case '[': { if (*p == '^') p++; do { /* look for a `]' */ if (*p == '\0') - luaL_error(ms->L, "malformed pattern (missing ']')"); + luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); if (*(p++) == L_ESC && *p != '\0') p++; /* skip escapes (e.g. `%]') */ } while (*p != ']'); @@ -382,7 +382,8 @@ static const char *match (MatchState *ms, const char *s, const char *p) { const char *ep; char previous; p += 2; if (*p != '[') - luaL_error(ms->L, "missing '[' after '%%f' in pattern"); + luaL_error(ms->L, "missing " LUA_QL("[") " after " + LUA_QL("%%f") " in pattern"); ep = classend(ms, p); /* points to what is next */ previous = (s == ms->src_init) ? '\0' : *(s-1); if (matchbracketclass(uchar(previous), p, ep-1) || @@ -741,7 +742,7 @@ static int str_format (lua_State *L) { } } default: { /* also treat cases `pnLlh' */ - return luaL_error(L, "invalid option to " LUA_SM, "format"); + return luaL_error(L, "invalid option to " LUA_QL("format")); } } luaL_addlstring(&b, buff, strlen(buff)); -- cgit v1.2.3-55-g6feb