3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.103
3ef2ca
Fcc: outbox
3ef2ca
From: Bram Moolenaar <Bram@moolenaar.net>
3ef2ca
Mime-Version: 1.0
3ef2ca
Content-Type: text/plain; charset=UTF-8
3ef2ca
Content-Transfer-Encoding: 8bit
3ef2ca
------------
3ef2ca
3ef2ca
Patch 7.4.103
3ef2ca
Problem:    Dos installer uses an old way to escape spaces in the diff
3ef2ca
	    command.
3ef2ca
Solution:   Adjust the quoting to the new default shellxquote. (Ben Fritz)
3ef2ca
Files:	    src/dosinst.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.102/src/dosinst.c	2013-11-07 04:49:23.000000000 +0100
3ef2ca
--- src/dosinst.c	2013-11-21 18:12:13.000000000 +0100
3ef2ca
***************
3ef2ca
*** 1192,1214 ****
3ef2ca
  	fprintf(fd, "  if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
3ef2ca
  
3ef2ca
  	/* If the path has a space:  When using cmd.exe (Win NT/2000/XP) put
3ef2ca
! 	 * quotes around the whole command and around the diff command.
3ef2ca
  	 * Otherwise put a double quote just before the space and at the
3ef2ca
  	 * end of the command.  Putting quotes around the whole thing
3ef2ca
  	 * doesn't work on Win 95/98/ME.  This is mostly guessed! */
3ef2ca
- 	fprintf(fd, "  let eq = ''\n");
3ef2ca
  	fprintf(fd, "  if $VIMRUNTIME =~ ' '\n");
3ef2ca
  	fprintf(fd, "    if &sh =~ '\\
3ef2ca
! 	fprintf(fd, "      let cmd = '\"\"' . $VIMRUNTIME . '\\diff\"'\n");
3ef2ca
! 	fprintf(fd, "      let eq = '\"'\n");
3ef2ca
  	fprintf(fd, "    else\n");
3ef2ca
  	fprintf(fd, "      let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n");
3ef2ca
  	fprintf(fd, "    endif\n");
3ef2ca
  	fprintf(fd, "  else\n");
3ef2ca
  	fprintf(fd, "    let cmd = $VIMRUNTIME . '\\diff'\n");
3ef2ca
  	fprintf(fd, "  endif\n");
3ef2ca
! 	fprintf(fd, "  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq\n");
3ef2ca
! 
3ef2ca
  	fprintf(fd, "endfunction\n");
3ef2ca
  	fprintf(fd, "\n");
3ef2ca
      }
3ef2ca
--- 1192,1220 ----
3ef2ca
  	fprintf(fd, "  if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n");
3ef2ca
  
3ef2ca
  	/* If the path has a space:  When using cmd.exe (Win NT/2000/XP) put
3ef2ca
! 	 * quotes around the diff command and rely on the default value of
3ef2ca
!          * shellxquote to solve the quoting problem for the whole command.
3ef2ca
!          *
3ef2ca
  	 * Otherwise put a double quote just before the space and at the
3ef2ca
  	 * end of the command.  Putting quotes around the whole thing
3ef2ca
  	 * doesn't work on Win 95/98/ME.  This is mostly guessed! */
3ef2ca
  	fprintf(fd, "  if $VIMRUNTIME =~ ' '\n");
3ef2ca
  	fprintf(fd, "    if &sh =~ '\\
3ef2ca
! 	fprintf(fd, "      if empty(&shellxquote)\n");
3ef2ca
! 	fprintf(fd, "        let l:shxq_sav = ''\n");
3ef2ca
! 	fprintf(fd, "        set shellxquote&\n");
3ef2ca
! 	fprintf(fd, "      endif\n");
3ef2ca
! 	fprintf(fd, "      let cmd = '\"' . $VIMRUNTIME . '\\diff\"'\n");
3ef2ca
  	fprintf(fd, "    else\n");
3ef2ca
  	fprintf(fd, "      let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n");
3ef2ca
  	fprintf(fd, "    endif\n");
3ef2ca
  	fprintf(fd, "  else\n");
3ef2ca
  	fprintf(fd, "    let cmd = $VIMRUNTIME . '\\diff'\n");
3ef2ca
  	fprintf(fd, "  endif\n");
3ef2ca
! 	fprintf(fd, "  silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n");
3ef2ca
! 	fprintf(fd, "  if exists('l:shxq_sav')\n");
3ef2ca
! 	fprintf(fd, "    let &shellxquote=l:shxq_sav\n");
3ef2ca
! 	fprintf(fd, "  endif\n");
3ef2ca
  	fprintf(fd, "endfunction\n");
3ef2ca
  	fprintf(fd, "\n");
3ef2ca
      }
3ef2ca
*** ../vim-7.4.102/src/version.c	2013-11-21 17:42:26.000000000 +0100
3ef2ca
--- src/version.c	2013-11-21 18:11:08.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     103,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
The fastest way to get an engineer to solve a problem is to declare that the
3ef2ca
problem is unsolvable.  No engineer can walk away from an unsolvable problem
3ef2ca
until it's solved.
3ef2ca
				(Scott Adams - The Dilbert principle)
3ef2ca
3ef2ca
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3ef2ca
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3ef2ca
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
3ef2ca
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///