diff options
Diffstat (limited to 'src/nvim/strings.c')
-rw-r--r-- | src/nvim/strings.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/strings.c b/src/nvim/strings.c index 16ae35272b..8fef4ba7fd 100644 --- a/src/nvim/strings.c +++ b/src/nvim/strings.c @@ -268,9 +268,9 @@ char *vim_strsave_shellescape(const char *string, bool do_special, bool do_newli } if (do_special && find_cmdline_var(p, &l) >= 0) { *d++ = '\\'; // insert backslash - while (--l != SIZE_MAX) { // copy the var - *d++ = *p++; - } + memcpy(d, p, l); // copy the var + d += l; + p += l; continue; } if (*p == '\\' && fish_like) { |