diff --git a/default-rsync.lua b/default-rsync.lua index c1369fb..9c5f910 100644 --- a/default-rsync.lua +++ b/default-rsync.lua @@ -199,12 +199,6 @@ rsync.action = function( inlet ) delete = { '--delete', '--ignore-errors' } end - log( - 'Normal', - 'Computed', - config.rsync._computed - ) - spawn( elist, config.rsync.binary, diff --git a/lsyncd.c b/lsyncd.c index b70e384..f5d3379 100644 --- a/lsyncd.c +++ b/lsyncd.c @@ -560,7 +560,7 @@ pipe_writey( } else if( pm->pos >= pm->tlen ) { - logstring("Exec", "finished pipe."); + logstring( "Exec", "finished pipe." ); nonobserve_fd(fd); } } @@ -1116,17 +1116,29 @@ l_exec( lua_State *L ) for( i = 1; i <= argc; i++ ) { lua_pushstring( L, " [" ); - lua_pushvalue( L, i + 1 ); + lua_pushvalue( L, i + 1 ); lua_pushstring( L, "]" ); } lua_concat( L, 3 * argc + 1 ); + // replaces midfile 0 chars by linefeed + size_t len = 0; + const char * cs = lua_tolstring( L, -1, &len ); + char * s = s_calloc( len + 1, sizeof( char ) ); + + for( i = 0; i < len; i++ ) + { + s[ i ] = cs[ i ] ? cs[ i ] : '\n'; + } + logstring0( LOG_DEBUG, "Exec", - luaL_checkstring(L, -1) + s ); + free( s ); + lua_pop( L, 1 ); }