lkundrak / rpms / vim

Forked from rpms/vim 4 years ago
Clone
4e72026
To: vim_dev@googlegroups.com
4e72026
Subject: Patch 7.4.175
4e72026
Fcc: outbox
4e72026
From: Bram Moolenaar <Bram@moolenaar.net>
4e72026
Mime-Version: 1.0
4e72026
Content-Type: text/plain; charset=UTF-8
4e72026
Content-Transfer-Encoding: 8bit
4e72026
------------
4e72026
4e72026
Patch 7.4.175
4e72026
Problem:    When a wide library function fails, falling back to the non-wide
4e72026
	    function may do the wrong thing.
4e72026
Solution:   Check the platform, when the wide function is supported don't fall
4e72026
	    back to the non-wide function. (Ken Takata)
4e72026
Files:	    src/os_mswin.c, src/os_win32.c
4e72026
4e72026
4e72026
*** ../vim-7.4.174/src/os_mswin.c	2014-01-14 12:18:41.000000000 +0100
4e72026
--- src/os_mswin.c	2014-02-11 17:02:03.002214267 +0100
4e72026
***************
4e72026
*** 648,654 ****
4e72026
  	{
4e72026
  	    n = wstat_symlink_aware(wp, (struct _stat *)stp);
4e72026
  	    vim_free(wp);
4e72026
! 	    if (n >= 0)
4e72026
  		return n;
4e72026
  	    /* Retry with non-wide function (for Windows 98). Can't use
4e72026
  	     * GetLastError() here and it's unclear what errno gets set to if
4e72026
--- 648,654 ----
4e72026
  	{
4e72026
  	    n = wstat_symlink_aware(wp, (struct _stat *)stp);
4e72026
  	    vim_free(wp);
4e72026
! 	    if (n >= 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
4e72026
  		return n;
4e72026
  	    /* Retry with non-wide function (for Windows 98). Can't use
4e72026
  	     * GetLastError() here and it's unclear what errno gets set to if
4e72026
***************
4e72026
*** 815,822 ****
4e72026
  	{
4e72026
  	    n = _wchdir(p);
4e72026
  	    vim_free(p);
4e72026
! 	    if (n == 0)
4e72026
! 		return 0;
4e72026
  	    /* Retry with non-wide function (for Windows 98). */
4e72026
  	}
4e72026
      }
4e72026
--- 815,822 ----
4e72026
  	{
4e72026
  	    n = _wchdir(p);
4e72026
  	    vim_free(p);
4e72026
! 	    if (n == 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
4e72026
! 		return n;
4e72026
  	    /* Retry with non-wide function (for Windows 98). */
4e72026
  	}
4e72026
      }
4e72026
***************
4e72026
*** 1942,1949 ****
4e72026
  
4e72026
  shortcut_errorw:
4e72026
  		vim_free(p);
4e72026
! 		if (hr == S_OK)
4e72026
! 		    goto shortcut_end;
4e72026
  	    }
4e72026
  	}
4e72026
  	/* Retry with non-wide function (for Windows 98). */
4e72026
--- 1942,1948 ----
4e72026
  
4e72026
  shortcut_errorw:
4e72026
  		vim_free(p);
4e72026
! 		goto shortcut_end;
4e72026
  	    }
4e72026
  	}
4e72026
  	/* Retry with non-wide function (for Windows 98). */
4e72026
*** ../vim-7.4.174/src/os_win32.c	2014-02-05 14:02:23.590105699 +0100
4e72026
--- src/os_win32.c	2014-02-11 16:59:26.810211874 +0100
4e72026
***************
4e72026
*** 2877,2882 ****
4e72026
--- 2877,2884 ----
4e72026
  		return OK;
4e72026
  	    }
4e72026
  	}
4e72026
+ 	else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
4e72026
+ 	    return FAIL;
4e72026
  	/* Retry with non-wide function (for Windows 98). */
4e72026
      }
4e72026
  #endif
4e72026
***************
4e72026
*** 2917,2922 ****
4e72026
--- 2919,2926 ----
4e72026
  		return;
4e72026
  	    }
4e72026
  	}
4e72026
+ 	else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
4e72026
+ 	    return;
4e72026
  	/* Retry with non-wide function (for Windows 98). */
4e72026
      }
4e72026
  #endif
4e72026
***************
4e72026
*** 2966,2971 ****
4e72026
--- 2970,2977 ----
4e72026
  		return OK;
4e72026
  	    }
4e72026
  	}
4e72026
+ 	else if (GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
4e72026
+ 	    return FAIL;
4e72026
  	/* Retry with non-wide function (for Windows 98). */
4e72026
      }
4e72026
  #endif
4e72026
***************
4e72026
*** 3006,3012 ****
4e72026
  	{
4e72026
  	    n = _wchmod(p, perm);
4e72026
  	    vim_free(p);
4e72026
! 	    if (n == -1 && GetLastError() != ERROR_CALL_NOT_IMPLEMENTED)
4e72026
  		return FAIL;
4e72026
  	    /* Retry with non-wide function (for Windows 98). */
4e72026
  	}
4e72026
--- 3012,3018 ----
4e72026
  	{
4e72026
  	    n = _wchmod(p, perm);
4e72026
  	    vim_free(p);
4e72026
! 	    if (n == -1 && g_PlatformId == VER_PLATFORM_WIN32_NT)
4e72026
  		return FAIL;
4e72026
  	    /* Retry with non-wide function (for Windows 98). */
4e72026
  	}
4e72026
***************
4e72026
*** 6048,6054 ****
4e72026
  	{
4e72026
  	    f = _wopen(wn, flags, mode);
4e72026
  	    vim_free(wn);
4e72026
! 	    if (f >= 0)
4e72026
  		return f;
4e72026
  	    /* Retry with non-wide function (for Windows 98). Can't use
4e72026
  	     * GetLastError() here and it's unclear what errno gets set to if
4e72026
--- 6054,6060 ----
4e72026
  	{
4e72026
  	    f = _wopen(wn, flags, mode);
4e72026
  	    vim_free(wn);
4e72026
! 	    if (f >= 0 || g_PlatformId == VER_PLATFORM_WIN32_NT)
4e72026
  		return f;
4e72026
  	    /* Retry with non-wide function (for Windows 98). Can't use
4e72026
  	     * GetLastError() here and it's unclear what errno gets set to if
4e72026
***************
4e72026
*** 6099,6105 ****
4e72026
  	_set_fmode(oldMode);
4e72026
  # endif
4e72026
  
4e72026
! 	if (f != NULL)
4e72026
  	    return f;
4e72026
  	/* Retry with non-wide function (for Windows 98). Can't use
4e72026
  	 * GetLastError() here and it's unclear what errno gets set to if
4e72026
--- 6105,6111 ----
4e72026
  	_set_fmode(oldMode);
4e72026
  # endif
4e72026
  
4e72026
! 	if (f != NULL || g_PlatformId == VER_PLATFORM_WIN32_NT)
4e72026
  	    return f;
4e72026
  	/* Retry with non-wide function (for Windows 98). Can't use
4e72026
  	 * GetLastError() here and it's unclear what errno gets set to if
4e72026
*** ../vim-7.4.174/src/version.c	2014-02-11 16:00:31.198157698 +0100
4e72026
--- src/version.c	2014-02-11 16:33:10.002187713 +0100
4e72026
***************
4e72026
*** 740,741 ****
4e72026
--- 740,743 ----
4e72026
  {   /* Add new patch number below this line */
4e72026
+ /**/
4e72026
+     175,
4e72026
  /**/
4e72026
4e72026
-- 
4e72026
DINGO:   And after the spanking ... the oral sex.
4e72026
GALAHAD: Oh, dear! Well, I...
4e72026
GIRLS:   The oral sex ...  The oral sex.
4e72026
GALAHAD: Well, I suppose I could stay a BIT longer.
4e72026
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
4e72026
4e72026
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
4e72026
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
4e72026
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
4e72026
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///