[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: string.format("%q",s) bug?
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Sun, 16 Apr 2006 18:00:12 -0300
> If I %q-format a string with \r in it, the \r gets entered into the
> string literally and the Lua interpreter barfs reading it back,
> contrary to the documentation. This is Lua5.1 (LuaJIT 1.1.0).
> Bug or my problem?
This is a bug, sorry. Here is a fix:
***************
*** 703,708 ****
--- 703,712 ----
luaL_addchar(b, *s);
break;
}
+ case '\r': {
+ luaL_addlstring(b, "\\r", 2);
+ break;
+ }
case '\0': {
luaL_addlstring(b, "\\000", 4);
break;