diff options
-rw-r--r-- | bugs | 48 | ||||
-rw-r--r-- | lstrlib.c | 6 |
2 files changed, 52 insertions, 2 deletions
@@ -806,7 +806,7 @@ Bug{ | |||
806 | what = [[In 16-bit machines, expressions and/or with numeric constants as the | 806 | what = [[In 16-bit machines, expressions and/or with numeric constants as the |
807 | right operand may result in weird values]], | 807 | right operand may result in weird values]], |
808 | 808 | ||
809 | report = [[Andreas Stenius, 15/03/2006]], | 809 | report = [[Andreas Stenius/Kein-Hong Man, 15/03/2006]], |
810 | 810 | ||
811 | example = [[ | 811 | example = [[ |
812 | print(false or 0) -- on 16-bit machines | 812 | print(false or 0) -- on 16-bit machines |
@@ -877,3 +877,49 @@ patch = [[ | |||
877 | 877 | ||
878 | } | 878 | } |
879 | 879 | ||
880 | |||
881 | Bug{ | ||
882 | what = [[ | ||
883 | In Windows, | ||
884 | when Lua is used in an application that also uses DirectX, | ||
885 | it may present an erractic behavior. | ||
886 | THIS IS NOT A LUA BUG! | ||
887 | The problem is that DirectX violates an ABI that Lua depends on.]], | ||
888 | |||
889 | patch = [[ | ||
890 | The simplest solution is to use DirectX with | ||
891 | the D3DCREATE_FPU_PRESERVE flag. | ||
892 | |||
893 | Otherwise, you can change the definition of lua_number2int, | ||
894 | in luaconf.h, to this one: | ||
895 | #define lua_number2int(i,d) __asm fld d __asm fistp i | ||
896 | ]], | ||
897 | |||
898 | } | ||
899 | |||
900 | |||
901 | Bug{ | ||
902 | what = [[option '%q' in string.format does not handle '\r' correctly.]], | ||
903 | |||
904 | example = [[ | ||
905 | local s = "a string with \r and \n and \r\n and \n\r" | ||
906 | local c = string.format("return %q", s) | ||
907 | assert(assert(loadstring(c))() == s) | ||
908 | ]], | ||
909 | |||
910 | patch = [[ | ||
911 | * lstrlib.c: | ||
912 | @@ -703,6 +703,10 @@ | ||
913 | luaL_addchar(b, *s); | ||
914 | break; | ||
915 | } | ||
916 | + case '\r': { | ||
917 | + luaL_addlstring(b, "\\r", 2); | ||
918 | + break; | ||
919 | + } | ||
920 | case '\0': { | ||
921 | luaL_addlstring(b, "\\000", 4); | ||
922 | break; | ||
923 | ]], | ||
924 | |||
925 | } | ||
@@ -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; |