summaryrefslogtreecommitdiff
path: root/lstrlib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-04-12 17:13:52 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2006-04-12 17:13:52 -0300
commit84879136970b76e5d1782f3b4664c7c8f9076821 (patch)
treed7cba2b3b7032c9bff3a01208c74b5d83a0209a6 /lstrlib.c
parent672bb67ee6b3f1c705fca4537824e6190c4a8d57 (diff)
downloadlua-84879136970b76e5d1782f3b4664c7c8f9076821.tar.gz
lua-84879136970b76e5d1782f3b4664c7c8f9076821.tar.bz2
lua-84879136970b76e5d1782f3b4664c7c8f9076821.zip
BUG: option '%q' for string.format does not handle '\r' correctly
Diffstat (limited to 'lstrlib.c')
-rw-r--r--lstrlib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lstrlib.c b/lstrlib.c
index 6020978d..82ae4ed7 100644
--- a/lstrlib.c
+++ b/lstrlib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstrlib.c,v 1.129 2005/12/21 12:59:43 roberto Exp roberto $ 2** $Id: lstrlib.c,v 1.130 2005/12/29 15:32:11 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*/
@@ -703,6 +703,10 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
703 luaL_addchar(b, *s); 703 luaL_addchar(b, *s);
704 break; 704 break;
705 } 705 }
706 case '\r': {
707 luaL_addlstring(b, "\\r", 2);
708 break;
709 }
706 case '\0': { 710 case '\0': {
707 luaL_addlstring(b, "\\000", 4); 711 luaL_addlstring(b, "\\000", 4);
708 break; 712 break;