jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone
8b9a1c
To: vim_dev@googlegroups.com
8b9a1c
Subject: Patch 7.4.096
8b9a1c
Fcc: outbox
8b9a1c
From: Bram Moolenaar <Bram@moolenaar.net>
8b9a1c
Mime-Version: 1.0
8b9a1c
Content-Type: text/plain; charset=UTF-8
8b9a1c
Content-Transfer-Encoding: 8bit
8b9a1c
------------
8b9a1c
8b9a1c
Patch 7.4.096
8b9a1c
Problem:    Can't change directory to an UNC path.
8b9a1c
Solution:   Use win32_getattrs() in mch_getperm(). (Christian Brabandt)
8b9a1c
Files:	    src/os_win32.c
8b9a1c
8b9a1c
8b9a1c
*** ../vim-7.4.095/src/os_win32.c	2013-09-25 19:13:32.000000000 +0200
8b9a1c
--- src/os_win32.c	2013-11-21 12:31:52.000000000 +0100
8b9a1c
***************
8b9a1c
*** 2841,2858 ****
8b9a1c
  }
8b9a1c
  
8b9a1c
  /*
8b9a1c
!  * get file permissions for `name'
8b9a1c
!  * -1 : error
8b9a1c
!  * else mode_t
8b9a1c
   */
8b9a1c
      long
8b9a1c
  mch_getperm(char_u *name)
8b9a1c
  {
8b9a1c
      struct stat st;
8b9a1c
!     int n;
8b9a1c
  
8b9a1c
      n = mch_stat(name, &st);
8b9a1c
!     return n == 0 ? (int)st.st_mode : -1;
8b9a1c
  }
8b9a1c
  
8b9a1c
  
8b9a1c
--- 2841,2860 ----
8b9a1c
  }
8b9a1c
  
8b9a1c
  /*
8b9a1c
!  * Get file permissions for "name".
8b9a1c
!  * Return mode_t or -1 for error.
8b9a1c
   */
8b9a1c
      long
8b9a1c
  mch_getperm(char_u *name)
8b9a1c
  {
8b9a1c
      struct stat st;
8b9a1c
!     int		n;
8b9a1c
  
8b9a1c
+     if (name[0] == '\\' && name[1] == '\\')
8b9a1c
+ 	/* UNC path */
8b9a1c
+ 	return (long)win32_getattrs(name);
8b9a1c
      n = mch_stat(name, &st);
8b9a1c
!     return n == 0 ? (long)st.st_mode : -1L;
8b9a1c
  }
8b9a1c
  
8b9a1c
  
8b9a1c
***************
8b9a1c
*** 3094,3101 ****
8b9a1c
   * -1 : error
8b9a1c
   * else FILE_ATTRIBUTE_* defined in winnt.h
8b9a1c
   */
8b9a1c
!     static
8b9a1c
!     int
8b9a1c
  win32_getattrs(char_u *name)
8b9a1c
  {
8b9a1c
      int		attr;
8b9a1c
--- 3096,3102 ----
8b9a1c
   * -1 : error
8b9a1c
   * else FILE_ATTRIBUTE_* defined in winnt.h
8b9a1c
   */
8b9a1c
!     static int
8b9a1c
  win32_getattrs(char_u *name)
8b9a1c
  {
8b9a1c
      int		attr;
8b9a1c
*** ../vim-7.4.095/src/version.c	2013-11-21 12:17:46.000000000 +0100
8b9a1c
--- src/version.c	2013-11-21 12:32:46.000000000 +0100
8b9a1c
***************
8b9a1c
*** 740,741 ****
8b9a1c
--- 740,743 ----
8b9a1c
  {   /* Add new patch number below this line */
8b9a1c
+ /**/
8b9a1c
+     96,
8b9a1c
  /**/
8b9a1c
8b9a1c
-- 
8b9a1c
If your company is not involved in something called "ISO 9000" you probably
8b9a1c
have no idea what it is.  If your company _is_ involved in ISO 9000 then you
8b9a1c
definitely have no idea what it is.
8b9a1c
				(Scott Adams - The Dilbert principle)
8b9a1c
8b9a1c
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
8b9a1c
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
8b9a1c
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
8b9a1c
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///