summaryrefslogtreecommitdiffstats
path: root/src/strings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings.c')
-rw-r--r--src/strings.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/strings.c b/src/strings.c
index 9b66ee0e4a..6b2ff0a011 100644
--- a/src/strings.c
+++ b/src/strings.c
@@ -269,12 +269,12 @@ vim_strsave_shellescape(char_u *string, int do_special, int do_newline)
*d++ = *p++;
continue;
}
- if (do_special && find_cmdline_var(p, &l) >= 0 && l > 0)
+ if (do_special && find_cmdline_var(p, &l) >= 0)
{
*d++ = '\\'; // insert backslash
- do // copy the var
- *d++ = *p++;
- while (--l > 0);
+ memcpy(d, p, l); // copy the var
+ d += l;
+ p += l;
continue;
}
if (*p == '\\' && fish_like)