From 84879136970b76e5d1782f3b4664c7c8f9076821 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 12 Apr 2006 17:13:52 -0300 Subject: BUG: option '%q' for string.format does not handle '\r' correctly --- lstrlib.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lstrlib.c') diff --git a/lstrlib.c b/lstrlib.c index 6020978d..82ae4ed7 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1,5 +1,5 @@ /* -** $Id: lstrlib.c,v 1.129 2005/12/21 12:59:43 roberto Exp roberto $ +** $Id: lstrlib.c,v 1.130 2005/12/29 15:32:11 roberto Exp roberto $ ** Standard library for string operations and pattern-matching ** See Copyright Notice in lua.h */ @@ -703,6 +703,10 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { luaL_addchar(b, *s); break; } + case '\r': { + luaL_addlstring(b, "\\r", 2); + break; + } case '\0': { luaL_addlstring(b, "\\000", 4); break; -- cgit v1.2.3-55-g6feb