small inter-operability patch for vim 6.1.2 for Cygwin

Bram Moolenaar
Mon Apr 22 12:08:00 GMT 2002

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

> (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 -- --  \\\
///   Creator of Vim -- --   \\\
\\\           Project leader for A-A-P --           ///
 \\\  Help me helping AIDS orphans in Uganda -  ///

Unsubscribe info:
Bug reporting:

More information about the Cygwin mailing list