I wrote earlier:
> To make test73 pass on unix, msvc-vim and djggp-vim I'll use uppercase letters
> for all the directory names that it uses (unless someone has a better idea).
I didn't work.
The test still fails due to the different ordering of the find
completion candidates:
$ ls -RF XFIND/
XFIND/:
file.txt IN/
XFIND/IN:
file.txt PATH/
XFIND/IN/PATH:
file.txt
$ vim -u NONE -c 'set nocp path=XFIND/**'
On djgpp-vim:
:find fi<Ctrl+d>
IN\file.txt c:\src\vim\src\testdir\XFIND\file.txt
PATH\file.txt
while on unix:
:find fi<Ctrl+d>
/home/nazri/src/vim/src/testdir/XFIND/file.txt PATH/file.txt
IN/file.txt
The the full path names resulting from the disambiguation of file.txt results
in the different ordering of the completion candidates for windows (djgpp) and
unix.
For this reason test73 fails when run with djgpp-vim, but the find
completion seems
to be fine with the attached patch.
(Side note: Using the uppercase filename is good in that it makes sure that the
ordering are not affected if someone runs the test from, say, the Z: drive
because it seems like the drive letter is kept at lowercase.)
Bram, does this warrant a separate test file for test73 on windows, to cater
for djgpp?
Attached patch fixes the detection of Windows for djgpp. No modification done
to test73 yet.
nazri.
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
From 3ef2a0a404aad89c107e4b9de593c26420f6aa2b Mon Sep 17 00:00:00 2001
From: Nazri Ramliy <[email protected]>
Date: Tue, 10 Aug 2010 08:54:16 +0800
Subject: [PATCH] find completion: Fix Windows platform detection
---
src/ex_getln.c | 2 +-
src/misc1.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 2475bb9..d292553 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -5040,7 +5040,7 @@ globpath(path, file, expand_options)
copy_option_part(&path, buf, MAXPATHL, ",");
if (STRLEN(buf) + STRLEN(file) + 2 < MAXPATHL)
{
-# ifdef WIN3264
+# if defined(MSWIN) || defined(MSDOS)
/* Using the platform's path separator (\) makes vim incorrectly
* treat it as an escape character, use '/' instead. */
if (*buf != NUL && !after_pathsep(buf, buf + STRLEN(buf)))
diff --git a/src/misc1.c b/src/misc1.c
index 911ba4a..fd4e4fe 100644
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -9374,7 +9374,7 @@ get_path_cutoff(fname, gap)
int j = 0;
while ((fname[j] == path_part[i][j]
-#if defined(WIN3264)
+# if defined(MSWIN) || defined(MSDOS)
|| (vim_ispathsep(fname[j]) && vim_ispathsep(path_part[i][j]))
#endif
) && fname[j] != NUL && path_part[i][j] != NUL)
@@ -9389,7 +9389,7 @@ get_path_cutoff(fname, gap)
/* Skip to the file or directory name */
if (cutoff != NULL)
while (
-#if defined(WIN3264)
+# if defined(MSWIN) || defined(MSDOS)
*cutoff == '/'
#else
vim_ispathsep(*cutoff)
@@ -9460,7 +9460,7 @@ uniquefy_paths(gap, pattern)
len = (int)STRLEN(path);
while (dir_end > path &&
-#if defined(WIN3264)
+# if defined(MSWIN) || defined(MSDOS)
*dir_end != '/'
#else
!vim_ispathsep(*dir_end)
--
1.7.2.1.6.g61bf12