|
@@ -1,5 +1,5 @@
|
|
/*
|
|
/*
|
|
-** $Id: ldump.c,v 2.35 2015/01/16 16:54:37 roberto Exp roberto $
|
|
|
|
|
|
+** $Id: ldump.c,v 2.36 2015/03/30 15:43:51 roberto Exp roberto $
|
|
** save precompiled Lua chunks
|
|
** save precompiled Lua chunks
|
|
** See Copyright Notice in lua.h
|
|
** See Copyright Notice in lua.h
|
|
*/
|
|
*/
|
|
@@ -38,7 +38,7 @@ typedef struct {
|
|
|
|
|
|
|
|
|
|
static void DumpBlock (const void *b, size_t size, DumpState *D) {
|
|
static void DumpBlock (const void *b, size_t size, DumpState *D) {
|
|
- if (D->status == 0) {
|
|
|
|
|
|
+ if (D->status == 0 && size > 0) {
|
|
lua_unlock(D->L);
|
|
lua_unlock(D->L);
|
|
D->status = (*D->writer)(D->L, b, size, D->data);
|
|
D->status = (*D->writer)(D->L, b, size, D->data);
|
|
lua_lock(D->L);
|
|
lua_lock(D->L);
|