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