3ef2ca
To: vim_dev@googlegroups.com
3ef2ca
Subject: Patch 7.4.096
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.096
3ef2ca
Problem:    Can't change directory to an UNC path.
3ef2ca
Solution:   Use win32_getattrs() in mch_getperm(). (Christian Brabandt)
3ef2ca
Files:	    src/os_win32.c
3ef2ca
3ef2ca
3ef2ca
*** ../vim-7.4.095/src/os_win32.c	2013-09-25 19:13:32.000000000 +0200
3ef2ca
--- src/os_win32.c	2013-11-21 12:31:52.000000000 +0100
3ef2ca
***************
3ef2ca
*** 2841,2858 ****
3ef2ca
  }
3ef2ca
  
3ef2ca
  /*
3ef2ca
!  * get file permissions for `name'
3ef2ca
!  * -1 : error
3ef2ca
!  * else mode_t
3ef2ca
   */
3ef2ca
      long
3ef2ca
  mch_getperm(char_u *name)
3ef2ca
  {
3ef2ca
      struct stat st;
3ef2ca
!     int n;
3ef2ca
  
3ef2ca
      n = mch_stat(name, &st);
3ef2ca
!     return n == 0 ? (int)st.st_mode : -1;
3ef2ca
  }
3ef2ca
  
3ef2ca
  
3ef2ca
--- 2841,2860 ----
3ef2ca
  }
3ef2ca
  
3ef2ca
  /*
3ef2ca
!  * Get file permissions for "name".
3ef2ca
!  * Return mode_t or -1 for error.
3ef2ca
   */
3ef2ca
      long
3ef2ca
  mch_getperm(char_u *name)
3ef2ca
  {
3ef2ca
      struct stat st;
3ef2ca
!     int		n;
3ef2ca
  
3ef2ca
+     if (name[0] == '\\' && name[1] == '\\')
3ef2ca
+ 	/* UNC path */
3ef2ca
+ 	return (long)win32_getattrs(name);
3ef2ca
      n = mch_stat(name, &st);
3ef2ca
!     return n == 0 ? (long)st.st_mode : -1L;
3ef2ca
  }
3ef2ca
  
3ef2ca
  
3ef2ca
***************
3ef2ca
*** 3094,3101 ****
3ef2ca
   * -1 : error
3ef2ca
   * else FILE_ATTRIBUTE_* defined in winnt.h
3ef2ca
   */
3ef2ca
!     static
3ef2ca
!     int
3ef2ca
  win32_getattrs(char_u *name)
3ef2ca
  {
3ef2ca
      int		attr;
3ef2ca
--- 3096,3102 ----
3ef2ca
   * -1 : error
3ef2ca
   * else FILE_ATTRIBUTE_* defined in winnt.h
3ef2ca
   */
3ef2ca
!     static int
3ef2ca
  win32_getattrs(char_u *name)
3ef2ca
  {
3ef2ca
      int		attr;
3ef2ca
*** ../vim-7.4.095/src/version.c	2013-11-21 12:17:46.000000000 +0100
3ef2ca
--- src/version.c	2013-11-21 12:32:46.000000000 +0100
3ef2ca
***************
3ef2ca
*** 740,741 ****
3ef2ca
--- 740,743 ----
3ef2ca
  {   /* Add new patch number below this line */
3ef2ca
+ /**/
3ef2ca
+     96,
3ef2ca
  /**/
3ef2ca
3ef2ca
-- 
3ef2ca
If your company is not involved in something called "ISO 9000" you probably
3ef2ca
have no idea what it is.  If your company _is_ involved in ISO 9000 then you
3ef2ca
definitely have no idea what it is.
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    ///