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]

small inter-operability patch for vim 6.1.2 for Cygwin


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 am not subscribed to vim-dev but have cc'ed it based on the comments in 
vim's README.txt.)

Thanks,
                Chris Metcalf -- InCert Software -- 1 (617) 621 8080
                metcalf@incert.com -- http://www.incert.com/~metcalf

--- vim-6.1-2/src/misc1.c	Sun Mar 17 08:12:29 2002
+++ vim-6.1-2-build/src/misc1.c	Mon Apr 22 13:35:36 2002
@@ -3709,7 +3709,11 @@
     return (c == '.' || c == ':');
 #else
 # ifdef UNIX
+#   ifdef __CYGWIN__  /* The OS will truly separate on ':' and '\\' */
+    return (c == ':' || c == '/' || c == '\\');
+#   else
     return (c == '/');	    /* UNIX has ':' inside file names */
+#   endif
 # else
 #  ifdef BACKSLASH_IN_FILENAME
     return (c == ':' || c == '/' || c == '\\');


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