1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
10 Patch 7.3.707 (after 7.3.701)
11 Problem: Problems loading a library for a file name with non-latin
13 Solution: Use wide system functions when possible. (Ken Takata)
14 Files: src/os_win32.c, src/os_win32.h
17 *** ../vim-7.3.706/src/os_win32.c 2012-10-21 02:37:02.000000000 +0200
18 --- src/os_win32.c 2012-10-21 21:33:58.000000000 +0200
22 vimLoadLib(char *name)
24 ! HINSTANCE dll = NULL;
25 ! TCHAR old_dir[MAXPATHL];
27 /* NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
28 * vimLoadLib() recursively, which causes a stack overflow. */
31 ! if (exe_path != NULL && GetCurrentDirectory(MAXPATHL, old_dir) != 0)
33 ! /* Change directory to where the executable is, both to make sure we
34 ! * find a .dll there and to avoid looking for a .dll in the current
36 ! SetCurrentDirectory(exe_path);
37 ! dll = LoadLibrary(name);
38 ! SetCurrentDirectory(old_dir);
42 ! /* We are not able to change directory to where the executable is, try
43 ! * to load library anyway. */
44 ! dll = LoadLibrary(name);
50 vimLoadLib(char *name)
52 ! HINSTANCE dll = NULL;
53 ! char old_dir[MAXPATHL];
55 /* NOTE: Do not use mch_dirname() and mch_chdir() here, they may call
56 * vimLoadLib() recursively, which causes a stack overflow. */
59 ! if (exe_path != NULL)
62 ! WCHAR old_dirw[MAXPATHL];
64 ! if (GetCurrentDirectoryW(MAXPATHL, old_dirw) != 0)
66 ! /* Change directory to where the executable is, both to make
67 ! * sure we find a .dll there and to avoid looking for a .dll
68 ! * in the current directory. */
69 ! SetCurrentDirectory(exe_path);
70 ! dll = LoadLibrary(name);
71 ! SetCurrentDirectoryW(old_dirw);
74 ! /* Retry with non-wide function (for Windows 98). */
75 ! if (GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
77 ! if (GetCurrentDirectory(MAXPATHL, old_dir) != 0)
79 ! /* Change directory to where the executable is, both to make
80 ! * sure we find a .dll there and to avoid looking for a .dll
81 ! * in the current directory. */
82 ! SetCurrentDirectory(exe_path);
83 ! dll = LoadLibrary(name);
84 ! SetCurrentDirectory(old_dir);
89 *** ../vim-7.3.706/src/os_win32.h 2011-08-10 17:07:56.000000000 +0200
90 --- src/os_win32.h 2012-10-21 21:33:30.000000000 +0200
94 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
96 ! /* _MAX_PATH is only 256 (stdlib.h), but we want more for the 'path' option,
97 * thus use a larger number. */
102 #define CMDBUFFSIZE 1024 /* size of the command processing buffer */
104 ! /* _MAX_PATH is only 260 (stdlib.h), but we want more for the 'path' option,
105 * thus use a larger number. */
106 #define MAXPATHL 1024
108 *** ../vim-7.3.706/src/version.c 2012-10-21 21:25:17.000000000 +0200
109 --- src/version.c 2012-10-21 21:37:52.000000000 +0200
113 { /* Add new patch number below this line */
119 Our job was to build a computer information system for the branch banks. We
120 were the perfect people for the job: Dean had seen a computer once, and I had
121 heard Dean talk about it.
122 (Scott Adams - The Dilbert principle)
124 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
125 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
126 \\\ an exciting new programming language -- http://www.Zimbu.org ///
127 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///