To: vim-dev@vim.org Subject: Patch 6.3.041 (extra) Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.3.041 (extra) Problem: Win32: When the path to a file has Russian characters, ":cd %:p:h" doesn't work. (Valery Kondakoff) Solution: Use a wide function to change directory. Files: src/os_mswin.c *** ../vim-6.3.040/src/os_mswin.c Sun Sep 5 20:48:38 2004 --- src/os_mswin.c Sun Dec 5 16:39:37 2004 *************** *** 633,638 **** --- 633,655 ---- if (*path == NUL) /* drive name only */ return 0; + #ifdef FEAT_MBYTE + if (enc_codepage >= 0 && (int)GetACP() != enc_codepage) + { + WCHAR *p = enc_to_ucs2(path, NULL); + int n; + + if (p != NULL) + { + n = _wchdir(p); + vim_free(p); + if (n == 0) + return 0; + /* Retry with non-wide function (for Windows 98). */ + } + } + #endif + return chdir(path); /* let the normal chdir() do the rest */ } *** ../vim-6.3.040/src/version.c Sun Dec 5 16:18:46 2004 --- src/version.c Sun Dec 5 16:42:01 2004 *************** *** 643,644 **** --- 643,646 ---- { /* Add new patch number below this line */ + /**/ + 41, /**/ -- For large projects, Team Leaders use sophisticated project management software to keep track of who's doing what. The software collects the lies and guesses of the project team and organizes them in to instantly outdated charts that are too boring to look at closely. This is called "planning". (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Buy LOTR 3 and help AIDS victims -- http://ICCF.nl/lotr.html ///