diff options
author | Bram Moolenaar <Bram@vim.org> | 2015-08-25 14:21:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2015-08-25 14:21:19 +0200 |
commit | be83b73ddb2ee8297037166d243f72e3423a3ce3 (patch) | |
tree | 9a0d9290fe19c42a17ed1f92b10828b47781b8d6 | |
parent | 3f188935ec4db5117c4a64cc3f71219175624745 (diff) | |
download | vim-git-be83b73ddb2ee8297037166d243f72e3423a3ce3.tar.gz |
patch 7.4.832v7.4.832
Problem: $HOME in is expanded too early.
Solution: Skip over when expanding environment names.
-rw-r--r-- | src/misc1.c | 20 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/misc1.c b/src/misc1.c index f32cb2513..ee2da0887 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -3969,6 +3969,26 @@ expand_env_esc(srcp, dst, dstlen, esc, one, startstr) --dstlen; /* leave one char space for "\," */ while (*src && dstlen > 0) { +#ifdef FEAT_EVAL + /* Skip over `=expr`. */ + if (src[0] == '`' && src[1] == '=') + { + size_t len; + + var = src; + src += 2; + (void)skip_expr(&src); + if (*src == '`') + ++src; + len = src - var; + if (len > (size_t)dstlen) + len = dstlen; + vim_strncpy(dst, var, len); + dst += len; + dstlen -= len; + continue; + } +#endif copy_char = TRUE; if ((*src == '$' #ifdef VMS diff --git a/src/version.c b/src/version.c index e99e87edf..8d1da06c9 100644 --- a/src/version.c +++ b/src/version.c @@ -742,6 +742,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 832, +/**/ 831, /**/ 830, |