Karsten Hopp 4e6b00
To: vim_dev@googlegroups.com
Karsten Hopp 4e6b00
Subject: Patch 7.4.423
Karsten Hopp 4e6b00
Fcc: outbox
Karsten Hopp 4e6b00
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 4e6b00
Mime-Version: 1.0
Karsten Hopp 4e6b00
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 4e6b00
Content-Transfer-Encoding: 8bit
Karsten Hopp 4e6b00
------------
Karsten Hopp 4e6b00
Karsten Hopp 4e6b00
Patch 7.4.423
Karsten Hopp 4e6b00
Problem:    expand("$shell") does not work as documented.
Karsten Hopp 4e6b00
Solution:   Do not escape the $ when expanding environment variables.
Karsten Hopp 4e6b00
Files:	    src/os_unix.c, src/misc1.c, src/vim.h
Karsten Hopp 4e6b00
Karsten Hopp 4e6b00
Karsten Hopp 4e6b00
*** ../vim-7.4.422/src/os_unix.c	2014-07-30 17:21:53.815518506 +0200
Karsten Hopp 4e6b00
--- src/os_unix.c	2014-08-29 12:47:57.230428808 +0200
Karsten Hopp 4e6b00
***************
Karsten Hopp 4e6b00
*** 5939,5948 ****
Karsten Hopp 4e6b00
  			*p++ = '\\';
Karsten Hopp 4e6b00
  		    ++j;
Karsten Hopp 4e6b00
  		}
Karsten Hopp 4e6b00
! 		else if (!intick && vim_strchr(SHELL_SPECIAL,
Karsten Hopp 4e6b00
! 							   pat[i][j]) != NULL)
Karsten Hopp 4e6b00
  		    /* Put a backslash before a special character, but not
Karsten Hopp 4e6b00
! 		     * when inside ``. */
Karsten Hopp 4e6b00
  		    *p++ = '\\';
Karsten Hopp 4e6b00
  
Karsten Hopp 4e6b00
  		/* Copy one character. */
Karsten Hopp 4e6b00
--- 5939,5950 ----
Karsten Hopp 4e6b00
  			*p++ = '\\';
Karsten Hopp 4e6b00
  		    ++j;
Karsten Hopp 4e6b00
  		}
Karsten Hopp 4e6b00
! 		else if (!intick
Karsten Hopp 4e6b00
! 			 && ((flags & EW_KEEPDOLLAR) == 0 || pat[i][j] != '$')
Karsten Hopp 4e6b00
! 			      && vim_strchr(SHELL_SPECIAL, pat[i][j]) != NULL)
Karsten Hopp 4e6b00
  		    /* Put a backslash before a special character, but not
Karsten Hopp 4e6b00
! 		     * when inside ``. And not for $var when EW_KEEPDOLLAR is
Karsten Hopp 4e6b00
! 		     * set. */
Karsten Hopp 4e6b00
  		    *p++ = '\\';
Karsten Hopp 4e6b00
  
Karsten Hopp 4e6b00
  		/* Copy one character. */
Karsten Hopp 4e6b00
*** ../vim-7.4.422/src/misc1.c	2014-08-06 17:44:09.867161966 +0200
Karsten Hopp 4e6b00
--- src/misc1.c	2014-08-29 12:48:11.390428839 +0200
Karsten Hopp 4e6b00
***************
Karsten Hopp 4e6b00
*** 78,84 ****
Karsten Hopp 4e6b00
  	    if (!list || lcs_tab1)    /* count a tab for what it is worth */
Karsten Hopp 4e6b00
  		count += ts - (count % ts);
Karsten Hopp 4e6b00
  	    else
Karsten Hopp 4e6b00
! 	/* in list mode, when tab is not set, count screen char width for Tab: ^I */
Karsten Hopp 4e6b00
  		count += ptr2cells(ptr);
Karsten Hopp 4e6b00
  	}
Karsten Hopp 4e6b00
  	else if (*ptr == ' ')
Karsten Hopp 4e6b00
--- 78,85 ----
Karsten Hopp 4e6b00
  	    if (!list || lcs_tab1)    /* count a tab for what it is worth */
Karsten Hopp 4e6b00
  		count += ts - (count % ts);
Karsten Hopp 4e6b00
  	    else
Karsten Hopp 4e6b00
! 		/* In list mode, when tab is not set, count screen char width
Karsten Hopp 4e6b00
! 		 * for Tab, displays: ^I */
Karsten Hopp 4e6b00
  		count += ptr2cells(ptr);
Karsten Hopp 4e6b00
  	}
Karsten Hopp 4e6b00
  	else if (*ptr == ' ')
Karsten Hopp 4e6b00
***************
Karsten Hopp 4e6b00
*** 10767,10773 ****
Karsten Hopp 4e6b00
  		    vim_free(p);
Karsten Hopp 4e6b00
  		    ga_clear_strings(&ga);
Karsten Hopp 4e6b00
  		    i = mch_expand_wildcards(num_pat, pat, num_file, file,
Karsten Hopp 4e6b00
! 								       flags);
Karsten Hopp 4e6b00
  		    recursive = FALSE;
Karsten Hopp 4e6b00
  		    return i;
Karsten Hopp 4e6b00
  		}
Karsten Hopp 4e6b00
--- 10768,10774 ----
Karsten Hopp 4e6b00
  		    vim_free(p);
Karsten Hopp 4e6b00
  		    ga_clear_strings(&ga);
Karsten Hopp 4e6b00
  		    i = mch_expand_wildcards(num_pat, pat, num_file, file,
Karsten Hopp 4e6b00
! 							 flags|EW_KEEPDOLLAR);
Karsten Hopp 4e6b00
  		    recursive = FALSE;
Karsten Hopp 4e6b00
  		    return i;
Karsten Hopp 4e6b00
  		}
Karsten Hopp 4e6b00
*** ../vim-7.4.422/src/vim.h	2014-08-23 14:16:11.880625637 +0200
Karsten Hopp 4e6b00
--- src/vim.h	2014-08-29 12:46:47.370428655 +0200
Karsten Hopp 4e6b00
***************
Karsten Hopp 4e6b00
*** 835,840 ****
Karsten Hopp 4e6b00
--- 835,841 ----
Karsten Hopp 4e6b00
  #define EW_ICASE	0x100	/* ignore case */
Karsten Hopp 4e6b00
  #define EW_NOERROR	0x200	/* no error for bad regexp */
Karsten Hopp 4e6b00
  #define EW_NOTWILD	0x400	/* add match with literal name if exists */
Karsten Hopp 4e6b00
+ #define EW_KEEPDOLLAR	0x800	/* do not escape $, $var is expanded */
Karsten Hopp 4e6b00
  /* Note: mostly EW_NOTFOUND and EW_SILENT are mutually exclusive: EW_NOTFOUND
Karsten Hopp 4e6b00
   * is used when executing commands and EW_SILENT for interactive expanding. */
Karsten Hopp 4e6b00
  
Karsten Hopp 4e6b00
*** ../vim-7.4.422/src/version.c	2014-08-29 12:08:39.686423658 +0200
Karsten Hopp 4e6b00
--- src/version.c	2014-08-29 12:48:54.138428932 +0200
Karsten Hopp 4e6b00
***************
Karsten Hopp 4e6b00
*** 743,744 ****
Karsten Hopp 4e6b00
--- 743,746 ----
Karsten Hopp 4e6b00
  {   /* Add new patch number below this line */
Karsten Hopp 4e6b00
+ /**/
Karsten Hopp 4e6b00
+     423,
Karsten Hopp 4e6b00
  /**/
Karsten Hopp 4e6b00
Karsten Hopp 4e6b00
-- 
Karsten Hopp 4e6b00
From "know your smileys":
Karsten Hopp 4e6b00
 :~)	A man with a tape recorder up his nose
Karsten Hopp 4e6b00
Karsten Hopp 4e6b00
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 4e6b00
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 4e6b00
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 4e6b00
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///