To: vim_dev@googlegroups.com Subject: Patch 8.0.0419 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0419 Problem: Test for v:progpath fails on MS-Windows. Solution: Expand to full path. Also add ".exe" when the path is an absolute path. Files: src/os_win32.c, src/main.c *** ../vim-8.0.0418/src/os_win32.c 2017-03-05 14:29:08.717325490 +0100 --- src/os_win32.c 2017-03-05 15:12:18.152262944 +0100 *************** *** 1921,1927 **** if (mch_getperm(name) != -1 && !mch_isdir(name)) { if (path != NULL) ! *path = vim_strsave((char_u *)name); return TRUE; } return FALSE; --- 1921,1932 ---- if (mch_getperm(name) != -1 && !mch_isdir(name)) { if (path != NULL) ! { ! if (mch_isFullName(name)) ! *path = vim_strsave((char_u *)name); ! else ! *path = FullName_save((char_u *)name, FALSE); ! } return TRUE; } return FALSE; *** ../vim-8.0.0418/src/main.c 2017-03-05 14:29:08.717325490 +0100 --- src/main.c 2017-03-05 15:06:05.156510344 +0100 *************** *** 3533,3563 **** set_progpath(char_u *argv0) { char_u *val = argv0; - #ifdef WIN32 - char_u *path = NULL; - #else - char_u buf[MAXPATHL]; - #endif /* A relative path containing a "/" will become invalid when using ":cd", * turn it into a full path. ! * On MS-Windows "vim.exe" is found in the current directory, thus also do ! * it when there is no path and the file exists. */ ! if (!mch_isFullName(argv0)) ! { # ifdef WIN32 ! if (mch_can_exe(argv0, &path, FALSE) && path != NULL) ! val = path; # else if (gettail(argv0) != argv0 && vim_FullName(argv0, buf, MAXPATHL, TRUE) != FAIL) val = buf; - # endif } set_vim_var_string(VV_PROGPATH, val, -1); ! #ifdef WIN32 vim_free(path); ! #endif } #endif /* NO_VIM_MAIN */ --- 3533,3562 ---- set_progpath(char_u *argv0) { char_u *val = argv0; /* A relative path containing a "/" will become invalid when using ":cd", * turn it into a full path. ! * On MS-Windows "vim" should be expanded to "vim.exe", thus always do ! * this. */ # ifdef WIN32 ! char_u *path = NULL; ! ! if (mch_can_exe(argv0, &path, FALSE) && path != NULL) ! val = path; # else + char_u buf[MAXPATHL]; + + if (!mch_isFullName(argv0)) + { if (gettail(argv0) != argv0 && vim_FullName(argv0, buf, MAXPATHL, TRUE) != FAIL) val = buf; } + # endif set_vim_var_string(VV_PROGPATH, val, -1); ! # ifdef WIN32 vim_free(path); ! # endif } #endif /* NO_VIM_MAIN */ *** ../vim-8.0.0418/src/version.c 2017-03-05 14:56:03.601083320 +0100 --- src/version.c 2017-03-05 15:07:04.464059946 +0100 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 419, /**/ -- ERROR 047: Keyboard not found. Press RETURN to continue. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///