diff options
Diffstat (limited to 'meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch')
-rw-r--r-- | meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch new file mode 100644 index 0000000000..0c48ea2876 --- /dev/null +++ b/meta-oe/recipes-devtools/lua/lua5.1/luaorg_2.patch | |||
@@ -0,0 +1,44 @@ | |||
1 | lua.org patch 2 for lua-5.1.5. | ||
2 | from http://www.lua.org/bugs.html | ||
3 | |||
4 | Upstream-Status: Backport | ||
5 | |||
6 | Signed-off-by: Marko Lindqvist <cazfi74@gmail.com> | ||
7 | diff -Nurd lua-5.1.5/src/lzio.c lua-5.1.5/src/lzio.c | ||
8 | --- lua-5.1.5/src/lzio.c 2007-12-27 15:02:25.000000000 +0200 | ||
9 | +++ lua-5.1.5/src/lzio.c 2013-10-25 11:32:45.773536572 +0300 | ||
10 | @@ -22,10 +22,14 @@ | ||
11 | size_t size; | ||
12 | lua_State *L = z->L; | ||
13 | const char *buff; | ||
14 | + if (z->eoz) return EOZ; | ||
15 | lua_unlock(L); | ||
16 | buff = z->reader(L, z->data, &size); | ||
17 | lua_lock(L); | ||
18 | - if (buff == NULL || size == 0) return EOZ; | ||
19 | + if (buff == NULL || size == 0) { | ||
20 | + z->eoz = 1; /* avoid calling reader function next time */ | ||
21 | + return EOZ; | ||
22 | + } | ||
23 | z->n = size - 1; | ||
24 | z->p = buff; | ||
25 | return char2int(*(z->p++)); | ||
26 | @@ -51,6 +55,7 @@ | ||
27 | z->data = data; | ||
28 | z->n = 0; | ||
29 | z->p = NULL; | ||
30 | + z->eoz = 0; | ||
31 | } | ||
32 | |||
33 | |||
34 | diff -Nurd lua-5.1.5/src/lzio.h lua-5.1.5/src/lzio.h | ||
35 | --- lua-5.1.5/src/lzio.h 2007-12-27 15:02:25.000000000 +0200 | ||
36 | +++ lua-5.1.5/src/lzio.h 2013-10-25 11:31:50.301537789 +0300 | ||
37 | @@ -59,6 +59,7 @@ | ||
38 | lua_Reader reader; | ||
39 | void* data; /* additional data */ | ||
40 | lua_State *L; /* Lua state (for reader) */ | ||
41 | + int eoz; /* true if reader has no more data */ | ||
42 | }; | ||
43 | |||
44 | |||