diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-05-04 14:20:33 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-05-04 14:20:33 -0300 |
| commit | 658ea8752b979102627e2fede7b7ddfbb67ba6c9 (patch) | |
| tree | 14f09313459cbd4cc6eba7fb75328f85a308c796 | |
| parent | aa73403ba41f7f0992e839e5eb3dd480ef3c01a3 (diff) | |
| download | lua-658ea8752b979102627e2fede7b7ddfbb67ba6c9.tar.gz lua-658ea8752b979102627e2fede7b7ddfbb67ba6c9.tar.bz2 lua-658ea8752b979102627e2fede7b7ddfbb67ba6c9.zip | |
no need to handle '\0' differently from other control chars in
format '%q'
| -rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lstrlib.c,v 1.150 2010/04/12 12:00:50 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.151 2010/04/12 16:13:02 roberto Exp roberto $ |
| 3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -756,7 +756,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { | |||
| 756 | } | 756 | } |
| 757 | else if (*s == '\0' || iscntrl(uchar(*s))) { | 757 | else if (*s == '\0' || iscntrl(uchar(*s))) { |
| 758 | char buff[10]; | 758 | char buff[10]; |
| 759 | if (*s != '\0' && !isdigit(uchar(*(s+1)))) | 759 | if (!isdigit(uchar(*(s+1)))) |
| 760 | sprintf(buff, "\\%d", uchar(*s)); | 760 | sprintf(buff, "\\%d", uchar(*s)); |
| 761 | else | 761 | else |
| 762 | sprintf(buff, "\\%03d", uchar(*s)); | 762 | sprintf(buff, "\\%03d", uchar(*s)); |
