jkunstle / rpms / vim

Forked from rpms/vim 3 years ago
Clone

Blame SOURCES/7.4.136

dcaee6
To: vim_dev@googlegroups.com
dcaee6
Subject: Patch 7.4.136
dcaee6
Fcc: outbox
dcaee6
From: Bram Moolenaar <Bram@moolenaar.net>
dcaee6
Mime-Version: 1.0
dcaee6
Content-Type: text/plain; charset=UTF-8
dcaee6
Content-Transfer-Encoding: 8bit
dcaee6
------------
dcaee6
dcaee6
Patch 7.4.136 (after 7.4.096)
dcaee6
Problem:    MS-Windows: When saving a file with a UNC path the file becomes
dcaee6
	    read-only.
dcaee6
Solution:   Don't mix up Win32 attributes and Unix attributes. (Ken Takata)
dcaee6
Files:	    src/os_mswin.c, src/os_win32.c
dcaee6
dcaee6
dcaee6
*** ../vim-7.4.135/src/os_mswin.c	2013-09-29 19:05:17.000000000 +0200
dcaee6
--- src/os_mswin.c	2014-01-10 13:03:19.000000000 +0100
dcaee6
***************
dcaee6
*** 617,624 ****
dcaee6
--- 617,638 ----
dcaee6
      p = buf + strlen(buf);
dcaee6
      if (p > buf)
dcaee6
  	mb_ptr_back(buf, p);
dcaee6
+ 
dcaee6
+     /* Remove trailing '\\' except root path. */
dcaee6
      if (p > buf && (*p == '\\' || *p == '/') && p[-1] != ':')
dcaee6
  	*p = NUL;
dcaee6
+ 
dcaee6
+     if ((buf[0] == '\\' && buf[1] == '\\') || (buf[0] == '/' && buf[1] == '/'))
dcaee6
+     {
dcaee6
+ 	/* UNC root path must be followed by '\\'. */
dcaee6
+ 	p = vim_strpbrk(buf + 2, "\\/");
dcaee6
+ 	if (p != NULL)
dcaee6
+ 	{
dcaee6
+ 	    p = vim_strpbrk(p + 1, "\\/");
dcaee6
+ 	    if (p == NULL)
dcaee6
+ 		STRCAT(buf, "\\");
dcaee6
+ 	}
dcaee6
+     }
dcaee6
  #ifdef FEAT_MBYTE
dcaee6
      if (enc_codepage >= 0 && (int)GetACP() != enc_codepage
dcaee6
  # ifdef __BORLANDC__
dcaee6
*** ../vim-7.4.135/src/os_win32.c	2014-01-05 13:29:16.000000000 +0100
dcaee6
--- src/os_win32.c	2014-01-10 12:59:32.000000000 +0100
dcaee6
***************
dcaee6
*** 2890,2898 ****
dcaee6
      struct stat st;
dcaee6
      int		n;
dcaee6
  
dcaee6
-     if (name[0] == '\\' && name[1] == '\\')
dcaee6
- 	/* UNC path */
dcaee6
- 	return (long)win32_getattrs(name);
dcaee6
      n = mch_stat(name, &st);
dcaee6
      return n == 0 ? (long)st.st_mode : -1L;
dcaee6
  }
dcaee6
--- 2890,2895 ----
dcaee6
*** ../vim-7.4.135/src/version.c	2014-01-06 15:51:46.000000000 +0100
dcaee6
--- src/version.c	2014-01-10 13:04:43.000000000 +0100
dcaee6
***************
dcaee6
*** 740,741 ****
dcaee6
--- 740,743 ----
dcaee6
  {   /* Add new patch number below this line */
dcaee6
+ /**/
dcaee6
+     136,
dcaee6
  /**/
dcaee6
dcaee6
-- 
dcaee6
hundred-and-one symptoms of being an internet addict:
dcaee6
128. You can access the Net -- via your portable and cellular phone.
dcaee6
dcaee6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
dcaee6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
dcaee6
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
dcaee6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///