mirror of
https://github.com/neovim/neovim.git
synced 2025-09-15 07:48:18 +00:00
Fix system() output truncation bug.
Replace NULs with SOH to restore the old behaviour of get_cmd_output().
This commit is contained in:
@@ -14480,6 +14480,9 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
|
|||||||
|
|
||||||
free(res);
|
free(res);
|
||||||
} else {
|
} else {
|
||||||
|
// res may contain several NULs before the final terminating one.
|
||||||
|
// Replace them with SOH (1) like in get_cmd_output() to avoid truncation.
|
||||||
|
memchrsub(res, NUL, 1, nread);
|
||||||
#ifdef USE_CRNL
|
#ifdef USE_CRNL
|
||||||
// translate <CR><NL> into <NL>
|
// translate <CR><NL> into <NL>
|
||||||
char *d = res;
|
char *d = res;
|
||||||
|
Reference in New Issue
Block a user