mirror of
https://github.com/lua/lua
synced 2026-09-29 04:35:58 +03:00
no need to handle '\0' differently from other control chars in
format '%q'
This commit is contained in:
parent
aa73403ba4
commit
658ea8752b
1 changed files with 2 additions and 2 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
** $Id: lstrlib.c,v 1.150 2010/04/12 12:00:50 roberto Exp roberto $
|
||||
** $Id: lstrlib.c,v 1.151 2010/04/12 16:13:02 roberto Exp roberto $
|
||||
** Standard library for string operations and pattern-matching
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
|
|
@ -756,7 +756,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
|
|||
}
|
||||
else if (*s == '\0' || iscntrl(uchar(*s))) {
|
||||
char buff[10];
|
||||
if (*s != '\0' && !isdigit(uchar(*(s+1))))
|
||||
if (!isdigit(uchar(*(s+1))))
|
||||
sprintf(buff, "\\%d", uchar(*s));
|
||||
else
|
||||
sprintf(buff, "\\%03d", uchar(*s));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue