This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: small inter-operability patch for vim 6.1.2 for Cygwin



Chris Metcalf wrote:

> This small change fixes an interoperability problem with vim in Cygwin. If
> the Cygwin vim is invoked by non-Cygwin aware tools, it may be passed a
> backslash-separated path.  Since vim is essentially Unix-built for Cygwin,
> it doesn't realize it should recognize the backslashes as path separators,
> and fails to create a valid .swp file path (error "E303").
> 
> For example, the Cygwin cvs.exe is substantially slower at updates than a
> non-Cygwin build, presumably because of stat() overheads.  Both versions
> of cvs.exe will use $EDITOR to get checkin comments from the user, but the
> non-Cygwin version will pass a C:\TEMP\... path to vim.  (While it is
> possible to set up a $CVSEDITOR .bat file that runs "cygpath -u" on its
> argument, this seems more like a bandaid than a proper fix.)
> 
> The attached patch just modifies the vim_ispathsep() function to be 
> Cygwin-aware.  IMHO, the full BACKSLASH_IN_FILENAME mechanism is 
> inappropriate for Cygwin vim, since it really wants to present a complete 
> Unix facade to the user.  However, when backslashes are supplied in 
> filenames, the underlying OS *will* treat them as directory separators, so 
> vim must be aware of special characters as separators.

I'm quite sure this is not a good solution.  It's just waiting to fail
in another place.  The Unix code just isn't prepared for backslashes in
a file name to be path separators, they are seen as escaping the special
meaning of characters.

Why not add something at the start of main() to change backslashes to
forward slashes?  Or better: Isn't there a cygwin trick for this
already?

> (I am not subscribed to vim-dev but have cc'ed it based on the comments in 
> vim's README.txt.)

Your message won't get to the vim-dev list then.  And you can't read
responses from others...

-- 
       His head smashed in,  and his heart cut out,
       And his liver removed, and his bowels unplugged,
       And his nostrils raped, and his bottom burned off,
       And his penis split ... and his ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
 \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]