Karsten Hopp 1571b8
To: vim-dev@vim.org
Karsten Hopp 1571b8
Subject: Patch 7.3.034
Karsten Hopp 1571b8
Fcc: outbox
Karsten Hopp 1571b8
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 1571b8
Mime-Version: 1.0
Karsten Hopp 1571b8
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 1571b8
Content-Transfer-Encoding: 8bit
Karsten Hopp 1571b8
------------
Karsten Hopp 1571b8
Karsten Hopp 1571b8
Patch 7.3.034
Karsten Hopp 1571b8
Problem:    Win32: may be loading .dll from the wrong directory.
Karsten Hopp 1571b8
Solution:   Go to the Vim executable directory when opening a library.
Karsten Hopp 1571b8
Files:	    src/gui_w32.c, src/if_lua.c, src/if_mzsch.c, src/if_perl.xs,
Karsten Hopp 1571b8
	    src/if_python.c, src/if_python3.c, src/if_ruby.c, src/mbyte.c,
Karsten Hopp 1571b8
	    src/os_mswin.c, src/os_win32.c, src/proto/os_win32.pro
Karsten Hopp 1571b8
Karsten Hopp 1571b8
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/gui_w32.c	2010-08-15 21:57:25.000000000 +0200
Karsten Hopp 1571b8
--- src/gui_w32.c	2010-10-22 21:49:27.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 1260,1266 ****
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      /* try and load the user32.dll library and get the entry points for
Karsten Hopp 1571b8
       * multi-monitor-support. */
Karsten Hopp 1571b8
!     if ((user32_lib = LoadLibrary("User32.dll")) != NULL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
  	pMonitorFromWindow = (TMonitorFromWindow)GetProcAddress(user32_lib,
Karsten Hopp 1571b8
  							 "MonitorFromWindow");
Karsten Hopp 1571b8
--- 1260,1266 ----
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      /* try and load the user32.dll library and get the entry points for
Karsten Hopp 1571b8
       * multi-monitor-support. */
Karsten Hopp 1571b8
!     if ((user32_lib = vimLoadLib("User32.dll")) != NULL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
  	pMonitorFromWindow = (TMonitorFromWindow)GetProcAddress(user32_lib,
Karsten Hopp 1571b8
  							 "MonitorFromWindow");
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 4188,4194 ****
Karsten Hopp 1571b8
      static void
Karsten Hopp 1571b8
  dyn_imm_load(void)
Karsten Hopp 1571b8
  {
Karsten Hopp 1571b8
!     hLibImm = LoadLibrary("imm32.dll");
Karsten Hopp 1571b8
      if (hLibImm == NULL)
Karsten Hopp 1571b8
  	return;
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
--- 4188,4194 ----
Karsten Hopp 1571b8
      static void
Karsten Hopp 1571b8
  dyn_imm_load(void)
Karsten Hopp 1571b8
  {
Karsten Hopp 1571b8
!     hLibImm = vimLoadLib("imm32.dll");
Karsten Hopp 1571b8
      if (hLibImm == NULL)
Karsten Hopp 1571b8
  	return;
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/if_lua.c	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 1571b8
--- src/if_lua.c	2010-10-22 21:49:39.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 49,55 ****
Karsten Hopp 1571b8
  # define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # define close_dll dlclose
Karsten Hopp 1571b8
  #else
Karsten Hopp 1571b8
! # define load_dll LoadLibrary
Karsten Hopp 1571b8
  # define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # define close_dll FreeLibrary
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
--- 49,55 ----
Karsten Hopp 1571b8
  # define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # define close_dll dlclose
Karsten Hopp 1571b8
  #else
Karsten Hopp 1571b8
! # define load_dll vimLoadLib
Karsten Hopp 1571b8
  # define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # define close_dll FreeLibrary
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/if_mzsch.c	2010-08-15 21:57:32.000000000 +0200
Karsten Hopp 1571b8
--- src/if_mzsch.c	2010-10-22 21:49:53.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 556,563 ****
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      if (hMzGC && hMzSch)
Karsten Hopp 1571b8
  	return OK;
Karsten Hopp 1571b8
!     hMzSch = LoadLibrary(sch_dll);
Karsten Hopp 1571b8
!     hMzGC = LoadLibrary(gc_dll);
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      if (!hMzSch)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
--- 556,563 ----
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      if (hMzGC && hMzSch)
Karsten Hopp 1571b8
  	return OK;
Karsten Hopp 1571b8
!     hMzSch = vimLoadLib(sch_dll);
Karsten Hopp 1571b8
!     hMzGC = vimLoadLib(gc_dll);
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      if (!hMzSch)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/if_perl.xs	2010-08-15 21:57:30.000000000 +0200
Karsten Hopp 1571b8
--- src/if_perl.xs	2010-10-22 21:53:06.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 106,112 ****
Karsten Hopp 1571b8
  #define close_dll dlclose
Karsten Hopp 1571b8
  #else
Karsten Hopp 1571b8
  #define PERL_PROC FARPROC
Karsten Hopp 1571b8
! #define load_dll LoadLibrary
Karsten Hopp 1571b8
  #define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  #define close_dll FreeLibrary
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
--- 106,112 ----
Karsten Hopp 1571b8
  #define close_dll dlclose
Karsten Hopp 1571b8
  #else
Karsten Hopp 1571b8
  #define PERL_PROC FARPROC
Karsten Hopp 1571b8
! #define load_dll vimLoadLib
Karsten Hopp 1571b8
  #define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  #define close_dll FreeLibrary
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/if_python.c	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 1571b8
--- src/if_python.c	2010-10-22 21:49:57.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 110,116 ****
Karsten Hopp 1571b8
  #  define close_dll dlclose
Karsten Hopp 1571b8
  #  define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # else
Karsten Hopp 1571b8
! #  define load_dll LoadLibrary
Karsten Hopp 1571b8
  #  define close_dll FreeLibrary
Karsten Hopp 1571b8
  #  define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # endif
Karsten Hopp 1571b8
--- 110,116 ----
Karsten Hopp 1571b8
  #  define close_dll dlclose
Karsten Hopp 1571b8
  #  define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # else
Karsten Hopp 1571b8
! #  define load_dll vimLoadLib
Karsten Hopp 1571b8
  #  define close_dll FreeLibrary
Karsten Hopp 1571b8
  #  define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # endif
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/if_python3.c	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 1571b8
--- src/if_python3.c	2010-10-22 21:50:01.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 88,94 ****
Karsten Hopp 1571b8
  #  define close_dll dlclose
Karsten Hopp 1571b8
  #  define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # else
Karsten Hopp 1571b8
! #  define load_dll LoadLibrary
Karsten Hopp 1571b8
  #  define close_dll FreeLibrary
Karsten Hopp 1571b8
  #  define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # endif
Karsten Hopp 1571b8
--- 88,94 ----
Karsten Hopp 1571b8
  #  define close_dll dlclose
Karsten Hopp 1571b8
  #  define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # else
Karsten Hopp 1571b8
! #  define load_dll vimLoadLib
Karsten Hopp 1571b8
  #  define close_dll FreeLibrary
Karsten Hopp 1571b8
  #  define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # endif
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/if_ruby.c	2010-09-29 13:02:48.000000000 +0200
Karsten Hopp 1571b8
--- src/if_ruby.c	2010-10-22 21:50:04.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 55,61 ****
Karsten Hopp 1571b8
  # define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # define close_dll dlclose
Karsten Hopp 1571b8
  #else
Karsten Hopp 1571b8
! # define load_dll LoadLibrary
Karsten Hopp 1571b8
  # define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # define close_dll FreeLibrary
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
--- 55,61 ----
Karsten Hopp 1571b8
  # define symbol_from_dll dlsym
Karsten Hopp 1571b8
  # define close_dll dlclose
Karsten Hopp 1571b8
  #else
Karsten Hopp 1571b8
! # define load_dll vimLoadLib
Karsten Hopp 1571b8
  # define symbol_from_dll GetProcAddress
Karsten Hopp 1571b8
  # define close_dll FreeLibrary
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/mbyte.c	2010-09-18 13:36:41.000000000 +0200
Karsten Hopp 1571b8
--- src/mbyte.c	2010-10-22 21:50:09.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 4159,4169 ****
Karsten Hopp 1571b8
  {
Karsten Hopp 1571b8
      if (hIconvDLL != 0 && hMsvcrtDLL != 0)
Karsten Hopp 1571b8
  	return TRUE;
Karsten Hopp 1571b8
!     hIconvDLL = LoadLibrary(DYNAMIC_ICONV_DLL);
Karsten Hopp 1571b8
      if (hIconvDLL == 0)		/* sometimes it's called libiconv.dll */
Karsten Hopp 1571b8
! 	hIconvDLL = LoadLibrary(DYNAMIC_ICONV_DLL_ALT);
Karsten Hopp 1571b8
      if (hIconvDLL != 0)
Karsten Hopp 1571b8
! 	hMsvcrtDLL = LoadLibrary(DYNAMIC_MSVCRT_DLL);
Karsten Hopp 1571b8
      if (hIconvDLL == 0 || hMsvcrtDLL == 0)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
  	/* Only give the message when 'verbose' is set, otherwise it might be
Karsten Hopp 1571b8
--- 4159,4169 ----
Karsten Hopp 1571b8
  {
Karsten Hopp 1571b8
      if (hIconvDLL != 0 && hMsvcrtDLL != 0)
Karsten Hopp 1571b8
  	return TRUE;
Karsten Hopp 1571b8
!     hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL);
Karsten Hopp 1571b8
      if (hIconvDLL == 0)		/* sometimes it's called libiconv.dll */
Karsten Hopp 1571b8
! 	hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT);
Karsten Hopp 1571b8
      if (hIconvDLL != 0)
Karsten Hopp 1571b8
! 	hMsvcrtDLL = vimLoadLib(DYNAMIC_MSVCRT_DLL);
Karsten Hopp 1571b8
      if (hIconvDLL == 0 || hMsvcrtDLL == 0)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
  	/* Only give the message when 'verbose' is set, otherwise it might be
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/os_mswin.c	2010-08-15 21:57:29.000000000 +0200
Karsten Hopp 1571b8
--- src/os_mswin.c	2010-10-22 22:03:26.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 817,823 ****
Karsten Hopp 1571b8
--- 817,827 ----
Karsten Hopp 1571b8
      BOOL fRunTimeLinkSuccess = FALSE;
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      // Get a handle to the DLL module.
Karsten Hopp 1571b8
+ # ifdef WIN16
Karsten Hopp 1571b8
      hinstLib = LoadLibrary(libname);
Karsten Hopp 1571b8
+ # else
Karsten Hopp 1571b8
+     hinstLib = vimLoadLib(libname);
Karsten Hopp 1571b8
+ # endif
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      // If the handle is valid, try to get the function address.
Karsten Hopp 1571b8
      if (hinstLib != NULL)
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/os_win32.c	2010-10-13 20:37:37.000000000 +0200
Karsten Hopp 1571b8
--- src/os_win32.c	2010-10-23 13:16:55.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 206,247 ****
Karsten Hopp 1571b8
  static int suppress_winsize = 1;	/* don't fiddle with console */
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      static void
Karsten Hopp 1571b8
  get_exe_name(void)
Karsten Hopp 1571b8
  {
Karsten Hopp 1571b8
!     char	temp[256];
Karsten Hopp 1571b8
!     static int	did_set_PATH = FALSE;
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      if (exe_name == NULL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
  	/* store the name of the executable, may be used for $VIM */
Karsten Hopp 1571b8
! 	GetModuleFileName(NULL, temp, 255);
Karsten Hopp 1571b8
  	if (*temp != NUL)
Karsten Hopp 1571b8
  	    exe_name = FullName_save((char_u *)temp, FALSE);
Karsten Hopp 1571b8
      }
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
!     if (!did_set_PATH && exe_name != NULL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
! 	char_u	    *p;
Karsten Hopp 1571b8
! 	char_u	    *newpath;
Karsten Hopp 1571b8
! 
Karsten Hopp 1571b8
! 	/* Append our starting directory to $PATH, so that when doing "!xxd"
Karsten Hopp 1571b8
! 	 * it's found in our starting directory.  Needed because SearchPath()
Karsten Hopp 1571b8
! 	 * also looks there. */
Karsten Hopp 1571b8
! 	p = mch_getenv("PATH");
Karsten Hopp 1571b8
! 	newpath = alloc((unsigned)(STRLEN(p) + STRLEN(exe_name) + 2));
Karsten Hopp 1571b8
! 	if (newpath != NULL)
Karsten Hopp 1571b8
! 	{
Karsten Hopp 1571b8
! 	    STRCPY(newpath, p);
Karsten Hopp 1571b8
! 	    STRCAT(newpath, ";");
Karsten Hopp 1571b8
! 	    vim_strncpy(newpath + STRLEN(newpath), exe_name,
Karsten Hopp 1571b8
! 					    gettail_sep(exe_name) - exe_name);
Karsten Hopp 1571b8
! 	    vim_setenv((char_u *)"PATH", newpath);
Karsten Hopp 1571b8
! 	    vim_free(newpath);
Karsten Hopp 1571b8
  	}
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
! 	did_set_PATH = TRUE;
Karsten Hopp 1571b8
      }
Karsten Hopp 1571b8
  }
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
  #if defined(DYNAMIC_GETTEXT) || defined(PROTO)
Karsten Hopp 1571b8
--- 206,268 ----
Karsten Hopp 1571b8
  static int suppress_winsize = 1;	/* don't fiddle with console */
Karsten Hopp 1571b8
  #endif
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
+ static char_u *exe_path = NULL;
Karsten Hopp 1571b8
+ 
Karsten Hopp 1571b8
      static void
Karsten Hopp 1571b8
  get_exe_name(void)
Karsten Hopp 1571b8
  {
Karsten Hopp 1571b8
!     char	temp[MAXPATHL];
Karsten Hopp 1571b8
!     char_u	*p;
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
      if (exe_name == NULL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
  	/* store the name of the executable, may be used for $VIM */
Karsten Hopp 1571b8
! 	GetModuleFileName(NULL, temp, MAXPATHL - 1);
Karsten Hopp 1571b8
  	if (*temp != NUL)
Karsten Hopp 1571b8
  	    exe_name = FullName_save((char_u *)temp, FALSE);
Karsten Hopp 1571b8
      }
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
!     if (exe_path == NULL && exe_name != NULL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
! 	exe_path = vim_strnsave(exe_name, gettail_sep(exe_name) - exe_name);
Karsten Hopp 1571b8
! 	if (exe_path != NULL)
Karsten Hopp 1571b8
! 	{
Karsten Hopp 1571b8
! 	    /* Append our starting directory to $PATH, so that when doing
Karsten Hopp 1571b8
! 	     * "!xxd" it's found in our starting directory.  Needed because
Karsten Hopp 1571b8
! 	     * SearchPath() also looks there. */
Karsten Hopp 1571b8
! 	    p = mch_getenv("PATH");
Karsten Hopp 1571b8
! 	    if (STRLEN(p) + STRLEN(exe_path) + 2 < MAXPATHL);
Karsten Hopp 1571b8
! 	    {
Karsten Hopp 1571b8
! 		STRCPY(temp, p);
Karsten Hopp 1571b8
! 		STRCAT(temp, ";");
Karsten Hopp 1571b8
! 		STRCAT(temp, exe_path);
Karsten Hopp 1571b8
! 		vim_setenv((char_u *)"PATH", temp);
Karsten Hopp 1571b8
! 	    }
Karsten Hopp 1571b8
  	}
Karsten Hopp 1571b8
+     }
Karsten Hopp 1571b8
+ }
Karsten Hopp 1571b8
+ 
Karsten Hopp 1571b8
+ /*
Karsten Hopp 1571b8
+  * Load library "name".
Karsten Hopp 1571b8
+  */
Karsten Hopp 1571b8
+     HINSTANCE
Karsten Hopp 1571b8
+ vimLoadLib(char *name)
Karsten Hopp 1571b8
+ {
Karsten Hopp 1571b8
+     HINSTANCE dll = NULL;
Karsten Hopp 1571b8
+     char old_dir[MAXPATHL];
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
!     if (exe_path == NULL)
Karsten Hopp 1571b8
! 	get_exe_name();
Karsten Hopp 1571b8
!     if (exe_path != NULL && mch_dirname(old_dir, MAXPATHL) == OK)
Karsten Hopp 1571b8
!     {
Karsten Hopp 1571b8
! 	/* Change directory to where the executable is, both to make sure we
Karsten Hopp 1571b8
! 	 * find a .dll there and to avoid looking for a .dll in the current
Karsten Hopp 1571b8
! 	 * directory. */
Karsten Hopp 1571b8
! 	mch_chdir(exe_path);
Karsten Hopp 1571b8
! 	dll = LoadLibrary(name);
Karsten Hopp 1571b8
! 	mch_chdir(old_dir);
Karsten Hopp 1571b8
      }
Karsten Hopp 1571b8
+     return dll;
Karsten Hopp 1571b8
  }
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
  #if defined(DYNAMIC_GETTEXT) || defined(PROTO)
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 254,260 ****
Karsten Hopp 1571b8
  static char *null_libintl_bindtextdomain(const char *, const char *);
Karsten Hopp 1571b8
  static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
! static HINSTANCE hLibintlDLL = 0;
Karsten Hopp 1571b8
  char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
Karsten Hopp 1571b8
  char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
Karsten Hopp 1571b8
  char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
Karsten Hopp 1571b8
--- 275,281 ----
Karsten Hopp 1571b8
  static char *null_libintl_bindtextdomain(const char *, const char *);
Karsten Hopp 1571b8
  static char *null_libintl_bind_textdomain_codeset(const char *, const char *);
Karsten Hopp 1571b8
  
Karsten Hopp 1571b8
! static HINSTANCE hLibintlDLL = NULL;
Karsten Hopp 1571b8
  char *(*dyn_libintl_gettext)(const char *) = null_libintl_gettext;
Karsten Hopp 1571b8
  char *(*dyn_libintl_textdomain)(const char *) = null_libintl_textdomain;
Karsten Hopp 1571b8
  char *(*dyn_libintl_bindtextdomain)(const char *, const char *)
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 282,307 ****
Karsten Hopp 1571b8
      if (hLibintlDLL)
Karsten Hopp 1571b8
  	return 1;
Karsten Hopp 1571b8
      /* Load gettext library (libintl.dll) */
Karsten Hopp 1571b8
!     hLibintlDLL = LoadLibrary(libname != NULL ? libname : GETTEXT_DLL);
Karsten Hopp 1571b8
      if (!hLibintlDLL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
! 	char_u	    dirname[_MAX_PATH];
Karsten Hopp 1571b8
! 
Karsten Hopp 1571b8
! 	/* Try using the path from gvim.exe to find the .dll there. */
Karsten Hopp 1571b8
! 	get_exe_name();
Karsten Hopp 1571b8
! 	STRCPY(dirname, exe_name);
Karsten Hopp 1571b8
! 	STRCPY(gettail(dirname), GETTEXT_DLL);
Karsten Hopp 1571b8
! 	hLibintlDLL = LoadLibrary((char *)dirname);
Karsten Hopp 1571b8
! 	if (!hLibintlDLL)
Karsten Hopp 1571b8
  	{
Karsten Hopp 1571b8
! 	    if (p_verbose > 0)
Karsten Hopp 1571b8
! 	    {
Karsten Hopp 1571b8
! 		verbose_enter();
Karsten Hopp 1571b8
! 		EMSG2(_(e_loadlib), GETTEXT_DLL);
Karsten Hopp 1571b8
! 		verbose_leave();
Karsten Hopp 1571b8
! 	    }
Karsten Hopp 1571b8
! 	    return 0;
Karsten Hopp 1571b8
  	}
Karsten Hopp 1571b8
      }
Karsten Hopp 1571b8
      for (i = 0; libintl_entry[i].name != NULL
Karsten Hopp 1571b8
  					 && libintl_entry[i].ptr != NULL; ++i)
Karsten Hopp 1571b8
--- 303,318 ----
Karsten Hopp 1571b8
      if (hLibintlDLL)
Karsten Hopp 1571b8
  	return 1;
Karsten Hopp 1571b8
      /* Load gettext library (libintl.dll) */
Karsten Hopp 1571b8
!     hLibintlDLL = vimLoadLib(libname != NULL ? libname : GETTEXT_DLL);
Karsten Hopp 1571b8
      if (!hLibintlDLL)
Karsten Hopp 1571b8
      {
Karsten Hopp 1571b8
! 	if (p_verbose > 0)
Karsten Hopp 1571b8
  	{
Karsten Hopp 1571b8
! 	    verbose_enter();
Karsten Hopp 1571b8
! 	    EMSG2(_(e_loadlib), GETTEXT_DLL);
Karsten Hopp 1571b8
! 	    verbose_leave();
Karsten Hopp 1571b8
  	}
Karsten Hopp 1571b8
+ 	return 0;
Karsten Hopp 1571b8
      }
Karsten Hopp 1571b8
      for (i = 0; libintl_entry[i].name != NULL
Karsten Hopp 1571b8
  					 && libintl_entry[i].ptr != NULL; ++i)
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 430,436 ****
Karsten Hopp 1571b8
  	     * Seems like a lot of overhead to load/unload ADVAPI32.DLL each
Karsten Hopp 1571b8
  	     * time we verify security...
Karsten Hopp 1571b8
  	     */
Karsten Hopp 1571b8
! 	    advapi_lib = LoadLibrary("ADVAPI32.DLL");
Karsten Hopp 1571b8
  	    if (advapi_lib != NULL)
Karsten Hopp 1571b8
  	    {
Karsten Hopp 1571b8
  		pSetNamedSecurityInfo = (PSNSECINFO)GetProcAddress(advapi_lib,
Karsten Hopp 1571b8
--- 441,447 ----
Karsten Hopp 1571b8
  	     * Seems like a lot of overhead to load/unload ADVAPI32.DLL each
Karsten Hopp 1571b8
  	     * time we verify security...
Karsten Hopp 1571b8
  	     */
Karsten Hopp 1571b8
! 	    advapi_lib = vimLoadLib("ADVAPI32.DLL");
Karsten Hopp 1571b8
  	    if (advapi_lib != NULL)
Karsten Hopp 1571b8
  	    {
Karsten Hopp 1571b8
  		pSetNamedSecurityInfo = (PSNSECINFO)GetProcAddress(advapi_lib,
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/proto/os_win32.pro	2010-08-15 21:57:28.000000000 +0200
Karsten Hopp 1571b8
--- src/proto/os_win32.pro	2010-10-22 22:05:35.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 1,4 ****
Karsten Hopp 1571b8
--- 1,5 ----
Karsten Hopp 1571b8
  /* os_win32.c */
Karsten Hopp 1571b8
+ HINSTANCE vimLoadLib __ARGS((char *name));
Karsten Hopp 1571b8
  int dyn_libintl_init __ARGS((char *libname));
Karsten Hopp 1571b8
  void dyn_libintl_end __ARGS((void));
Karsten Hopp 1571b8
  void PlatformId __ARGS((void));
Karsten Hopp 1571b8
*** ../vim-7.3.033/src/version.c	2010-10-22 22:13:47.000000000 +0200
Karsten Hopp 1571b8
--- src/version.c	2010-10-23 13:55:21.000000000 +0200
Karsten Hopp 1571b8
***************
Karsten Hopp 1571b8
*** 716,717 ****
Karsten Hopp 1571b8
--- 716,719 ----
Karsten Hopp 1571b8
  {   /* Add new patch number below this line */
Karsten Hopp 1571b8
+ /**/
Karsten Hopp 1571b8
+     34,
Karsten Hopp 1571b8
  /**/
Karsten Hopp 1571b8
Karsten Hopp 1571b8
-- 
Karsten Hopp 1571b8
This is the polymorph virus!  Follow these instructions carefully:
Karsten Hopp 1571b8
1. Send this message to everybody you know.
Karsten Hopp 1571b8
2. Format your harddisk.
Karsten Hopp 1571b8
Thank you for your cooperation in spreading the most powerful virus ever!
Karsten Hopp 1571b8
Karsten Hopp 1571b8
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 1571b8
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 1571b8
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 1571b8
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///