Bram,
On Jun 25 12:06, Corinna Vinschen wrote:
> On Jun 24 18:18, Gary Johnson wrote:
> > Ditto. I just finished installing it and successfully running "make
> > test" on
> >
> > Cygwin on Windows XP
>
> Out of curiosity: Which Cygwin version are you running? 1.5.25?
>
> `make test' also builds and runs fine in a test release of the upcoming
> new major Cygwin version 1.7.0.
btw., beginning with 1.7.0, Cygwin will allow to use long paths on
Windows, longer than the usual MAX_PATH=260 chars. PATH_MAX is now
4096.
Right now, vim uses the function cygwin_conv_to_posix_path to convert
Win32 paths to POSIX paths. The problem with this function is that
it only allows to work with MAX_PATH long paths. The reason to keep
it at that is not to break old applications which use static buffers of
MAX_PATH length.
As a replacement function, we now have the function `cygwin_conv_path',
which allows to deal with paths of arbitrary length.
Below is a patch which replaces the cygwin_conv_to_posix_path with calls
to cygwin_conv_path, if we build for Cygwin 1.7. This is the simple
approach. Another one would be along the lines of:
ssize_t size;
char *posix_path;
size = cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, NULL, 0);
posix_path = (char *) alloca(size);
cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, posix_path, size);
Please let me know if you would rather like to use that approach
instead of just relying on PATH_MAX.
Corinna
--- main.c.ORIG 2008-06-25 12:26:39.000000000 +0200
+++ main.c 2008-06-25 12:24:33.000000000 +0200
@@ -20,7 +20,8 @@
#ifdef __CYGWIN__
# ifndef WIN32
-# include <sys/cygwin.h> /* for cygwin_conv_to_posix_path() */
+# include <cygwin/version.h>
+# include <sys/cygwin.h> /* for cygwin_conv_path() */
# endif
# include <limits.h>
#endif
@@ -2213,7 +2214,11 @@ scripterror:
{
char posix_path[PATH_MAX];
+#if CYGWIN_VERSION_DLL_MAJOR >= 1007
+ cygwin_conv_path(CCP_WIN_A_TO_POSIX, p, posix_path, PATH_MAX);
+#else
cygwin_conv_to_posix_path(p, posix_path);
+#endif
vim_free(p);
p = vim_strsave(posix_path);
if (p == NULL)
--- os_unix.c.ORIG 2008-06-25 12:29:12.000000000 +0200
+++ os_unix.c 2008-06-25 12:25:11.000000000 +0200
@@ -58,7 +58,8 @@ static int selinux_enabled = -1;
#ifdef __CYGWIN__
# ifndef WIN32
-# include <sys/cygwin.h> /* for cygwin_conv_to_posix_path() */
+# include <cygwin/version.h>
+# include <sys/cygwin.h> /* for cygwin_conv_path() */
# endif
#endif
@@ -2300,8 +2301,7 @@ mch_FullName(fname, buf, len, force)
char_u *p;
int retval = OK;
#ifdef __CYGWIN__
- char_u posix_fname[MAXPATHL]; /* Cygwin docs mention MAX_PATH, but
- it's not always defined */
+ char_u posix_fname[MAXPATHL];
#endif
#ifdef VMS
@@ -2312,7 +2312,11 @@ mch_FullName(fname, buf, len, force)
/*
* This helps for when "/etc/hosts" is a symlink to "c:/something/hosts".
*/
+#if CYGWIN_VERSION_DLL_MAJOR >= 1007
+ cygwin_conv_path(CCP_WIN_A_TO_POSIX, fname, posix_fname, MAXPATHL);
+#else
cygwin_conv_to_posix_path(fname, posix_fname);
+#endif
fname = posix_fname;
#endif
--
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---