diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-20 03:56:56 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-20 03:56:56 +0000 |
commit | 75a9fa68f6cdd6769813a8c5e055bfb00a08c089 (patch) | |
tree | daf1676b4e5ea491b7a370467a24b8181cc21827 /src/strings.c | |
parent | Adding upstream version 2:9.1.0377. (diff) | |
download | vim-upstream/2%9.1.0496.tar.xz vim-upstream/2%9.1.0496.zip |
Adding upstream version 2:9.1.0496.upstream/2%9.1.0496
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/strings.c')
-rw-r--r-- | src/strings.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/strings.c b/src/strings.c index 33de175..6b2ff0a 100644 --- a/src/strings.c +++ b/src/strings.c @@ -151,7 +151,7 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline) char_u *p; char_u *d; char_u *escaped_string; - int l; + size_t l; int csh_like; int fish_like; char_u *shname; @@ -272,8 +272,9 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline) if (do_special && find_cmdline_var(p, &l) >= 0) { *d++ = '\\'; // insert backslash - while (--l >= 0) // copy the var - *d++ = *p++; + memcpy(d, p, l); // copy the var + d += l; + p += l; continue; } if (*p == '\\' && fish_like) |