summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.096
blob: be20959b3bec9fbc6bdba804b70540e75fc63f78 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
To: vim_dev@googlegroups.com
Subject: Patch 7.4.096
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.096
Problem:    Can't change directory to an UNC path.
Solution:   Use win32_getattrs() in mch_getperm(). (Christian Brabandt)
Files:	    src/os_win32.c


*** ../vim-7.4.095/src/os_win32.c	2013-09-25 19:13:32.000000000 +0200
--- src/os_win32.c	2013-11-21 12:31:52.000000000 +0100
***************
*** 2841,2858 ****
  }
  
  /*
!  * get file permissions for `name'
!  * -1 : error
!  * else mode_t
   */
      long
  mch_getperm(char_u *name)
  {
      struct stat st;
!     int n;
  
      n = mch_stat(name, &st);
!     return n == 0 ? (int)st.st_mode : -1;
  }
  
  
--- 2841,2860 ----
  }
  
  /*
!  * Get file permissions for "name".
!  * Return mode_t or -1 for error.
   */
      long
  mch_getperm(char_u *name)
  {
      struct stat st;
!     int		n;
  
+     if (name[0] == '\\' && name[1] == '\\')
+ 	/* UNC path */
+ 	return (long)win32_getattrs(name);
      n = mch_stat(name, &st);
!     return n == 0 ? (long)st.st_mode : -1L;
  }
  
  
***************
*** 3094,3101 ****
   * -1 : error
   * else FILE_ATTRIBUTE_* defined in winnt.h
   */
!     static
!     int
  win32_getattrs(char_u *name)
  {
      int		attr;
--- 3096,3102 ----
   * -1 : error
   * else FILE_ATTRIBUTE_* defined in winnt.h
   */
!     static int
  win32_getattrs(char_u *name)
  {
      int		attr;
*** ../vim-7.4.095/src/version.c	2013-11-21 12:17:46.000000000 +0100
--- src/version.c	2013-11-21 12:32:46.000000000 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     96,
  /**/

-- 
If your company is not involved in something called "ISO 9000" you probably
have no idea what it is.  If your company _is_ involved in ISO 9000 then you
definitely have no idea what it is.
				(Scott Adams - The Dilbert principle)

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///