mirror of https://github.com/octoleo/lsyncd.git
+ fixing 0 characters in -log Exec message for pipes
This commit is contained in:
parent
25a2274d83
commit
6290bd6ea7
|
@ -199,12 +199,6 @@ rsync.action = function( inlet )
|
||||||
delete = { '--delete', '--ignore-errors' }
|
delete = { '--delete', '--ignore-errors' }
|
||||||
end
|
end
|
||||||
|
|
||||||
log(
|
|
||||||
'Normal',
|
|
||||||
'Computed',
|
|
||||||
config.rsync._computed
|
|
||||||
)
|
|
||||||
|
|
||||||
spawn(
|
spawn(
|
||||||
elist,
|
elist,
|
||||||
config.rsync.binary,
|
config.rsync.binary,
|
||||||
|
|
14
lsyncd.c
14
lsyncd.c
|
@ -1122,11 +1122,23 @@ l_exec( lua_State *L )
|
||||||
|
|
||||||
lua_concat( L, 3 * argc + 1 );
|
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(
|
logstring0(
|
||||||
LOG_DEBUG, "Exec",
|
LOG_DEBUG, "Exec",
|
||||||
luaL_checkstring(L, -1)
|
s
|
||||||
);
|
);
|
||||||
|
|
||||||
|
free( s );
|
||||||
|
|
||||||
lua_pop( L, 1 );
|
lua_pop( L, 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue