On Jun 26 00:05, Bram Moolenaar wrote:
> Corinna Vinschen wrote:
> > 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.
> 
> Using an array on the stack looks fine to me.  Glad to see the buggy
> function is being replaced.  I'll include this patch one of the coming
> days.

Thank you!

> You mention MAX_PATH and PATH_MAX, I think only PATH_MAX is a standard
> Unix thing.  But some (older?) versions of cygwin don't define it, as
> someone mentioned.

Very *very* old?

PATH_MAX is defined in Cygwin since at least 1996.  It was originally
defined in sys/param.h, but has been moved to limits.h already in 1997.


Corinna

-- 
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
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui