summaryrefslogtreecommitdiffstats
path: root/src/strings.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:56 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-20 03:56:56 +0000
commit75a9fa68f6cdd6769813a8c5e055bfb00a08c089 (patch)
treedaf1676b4e5ea491b7a370467a24b8181cc21827 /src/strings.c
parentAdding upstream version 2:9.1.0377. (diff)
downloadvim-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.c7
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)