To: vim-dev@vim.org Subject: Patch 6.0.036 Fcc: outbox From: Bram Moolenaar MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.0.036 Problem: OS/2, MS-DOS and MS-Windows: Using a path that starts with a slash in 'tags' doesn't work as expected. (Mathias Koehrer Solution: Only use the drive, not the whole path to the current directory. Also make it work for "c:dir/file". Files: src/misc2.c *** ../vim60.35/src/misc2.c Sun Oct 28 21:57:01 2001 --- src/misc2.c Mon Oct 29 17:14:44 2001 *************** *** 3532,3542 **** } else if (*path == NUL || !vim_isAbsName(path)) { ! if (mch_dirname(ff_expand_buffer, MAXPATHL) == OK) ! ff_search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer); if (ff_search_ctx->ffsc_start_dir == NULL) goto error_return; } #ifdef FEAT_PATH_EXTRA --- 3533,3568 ---- } else if (*path == NUL || !vim_isAbsName(path)) { ! #ifdef BACKSLASH_IN_FILENAME ! /* "c:dir" needs "c:" to be expanded, otherwise use current dir */ ! if (path[1] == ':') ! { ! char_u drive[3]; ! ! drive[0] = path[0]; ! drive[1] = ':'; ! drive[2] = NUL; ! if (vim_FullName(drive, ff_expand_buffer, MAXPATHL, TRUE) == FAIL) ! goto error_return; ! path += 2; ! } ! else ! #endif ! if (mch_dirname(ff_expand_buffer, MAXPATHL) == FAIL) ! goto error_return; + ff_search_ctx->ffsc_start_dir = vim_strsave(ff_expand_buffer); if (ff_search_ctx->ffsc_start_dir == NULL) goto error_return; + + #ifdef BACKSLASH_IN_FILENAME + /* A path that starts with "/dir" is relative to the drive, not to the + * directory (but not for "//machine/dir"). Only use the drive name. */ + if ((*path == '/' || *path == '\\') + && path[1] != path[0] + && ff_search_ctx->ffsc_start_dir[1] == ':') + ff_search_ctx->ffsc_start_dir[2] = NUL; + #endif } #ifdef FEAT_PATH_EXTRA *** ../vim60.35/src/version.c Mon Oct 29 15:24:28 2001 --- src/version.c Mon Oct 29 16:38:23 2001 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 36, /**/ -- Did you ever stop to think... and forget to start again? -- Steven Wright /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///