]> granicus.if.org Git - vim/commitdiff
patch 7.4.832 v7.4.832
authorBram Moolenaar <Bram@vim.org>
Tue, 25 Aug 2015 12:21:19 +0000 (14:21 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 25 Aug 2015 12:21:19 +0000 (14:21 +0200)
Problem:    $HOME in  is expanded too early.
Solution:   Skip over  when expanding environment names.

src/misc1.c
src/version.c

index f32cb251304bddb06f575cccf865f8e41a3634bd..ee2da0887bead2965a125d6c2d33653b9538beda 100644 (file)
@@ -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
index e99e87edf5be802b60c64b4d1573ea532b354197..8d1da06c9498bcdc7d588fb301b8afd9c3373643 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    832,
 /**/
     831,
 /**/