lua

A copy of the Lua development repository
Log | Files | Refs | README

commit c3e9b14d24afe14b2fc59c83d134430be5568769
parent 7d6b78ee7934a00fbc69ab04ba36aa420db8ba76
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Thu, 25 Feb 2016 16:42:29 -0300

'\0' is a control character, no need to check it explicitly

Diffstat:
Mlstrlib.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lstrlib.c b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.238 2015/11/23 11:31:21 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.239 2015/11/25 16:28:17 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -931,7 +931,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { luaL_addchar(b, '\\'); luaL_addchar(b, *s); } - else if (*s == '\0' || iscntrl(uchar(*s))) { + else if (iscntrl(uchar(*s))) { char buff[10]; if (!isdigit(uchar(*(s+1)))) l_sprintf(buff, sizeof(buff), "\\%d", (int)uchar(*s));