Luca Masini wrote:

> Bram Moolenaar wrote:
> 
>  > The mch_FullName() in os_unix.c already takes care of symlinks.  Why
>  > would this extra code for Cygwin be needed?
>  >
>  > If something needs to be patched it's probably best done in 
> mch_FullName().
> 
> 
> In cygwin /etc/hosts is a symbolic link to 
> C:\WINDOWS\system32\drivers\etc\hosts
> and if expanded in that way is not recognized as a full path because
> does not start with / or with ~.

A symlink from a Unix-style path to a DOS-style path?  That appears to
be the problem to me.  It's a bad symlink.  Unix programs will not work
properly with this symlink.

> The small patch change it in posix format
>   /cygdrive/c/WINDOWS/system32/drivers/etc/hosts
> so it is recognized as a full path

Then why don't you change the symlink to this path?

> and the .swp file is created (in the other case there is the message
> "*E303* Unable to open swap file")
> 
> Maybe the mch_FullName() is a better place to put the
> cygwin_conv_to_posix_path().
> I have put it there because there is also slash_adjust() for other
> platform.

slash_adjust() only changes "\" to "/", which doesn't change the length
of the path.  I assume that cygwin_conv_to_posix_path() can change the
length, thus it's a very different thing.

I think the Cygwin version of Vim should never see "C:/path" things,
thus converting all paths sounds like a good idea.   Probably near the
start of mch_FullName().  However, I don't know if this breaks
something.  I never use the Cygwin version.

-- 
DENNIS: Oh, very nice. King, eh!  I expect you've got a palace and fine
        clothes and courtiers and plenty of food.  And how d'you get that?  By
        exploiting the workers! By hanging on to outdated imperialist dogma
        which perpetuates the social and economic differences in our society!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

Reply via email to