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