public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* small inter-operability patch for vim 6.1.2 for Cygwin
@ 2002-04-22 11:30 Chris Metcalf
  2002-04-22 12:08 ` Bram Moolenaar
  0 siblings, 1 reply; 15+ messages in thread
From: Chris Metcalf @ 2002-04-22 11:30 UTC (permalink / raw)
  To: Bram; +Cc: cygwin, vim-dev

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/

^ permalink raw reply	[flat|nested] 15+ messages in thread
* RE: small inter-operability patch for vim 6.1.2 for cygwin
@ 2002-04-22 12:41 Richard Campbell
  0 siblings, 0 replies; 15+ messages in thread
From: Richard Campbell @ 2002-04-22 12:41 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

>Can anyone post the man page for this for Bram?  I'm away from my
>windows machine right now, and can't do it.

C:\>man cygwin_conv_to_posix_path
CYGWIN_CONV_TO_POSIX_PATH(3)         CYGWIN_CONV_TO_POSIX_PATH(3)

SYNOPSIS
       extern "C" void
       cygwin_conv_to_posix_path  (const  char  *  path,  char  *
       posix_path);

DESCRIPTION
       Converts a Win32 path to a POSIX path.  If path is already
       a  POSIX path, leaves it alone. If  path is relative, then
       posix_path will also be relative.   Note  that  posix_path
       must point to a buffer of sufficient size; use MAX_PATH if
       needed.

COPYRIGHT
       Cygwin is Copyright (C)  1995,  1996,  1997,  1998,  1999,
       2000, 2001, 2002 Red Hat, Inc.

       Cygwin  is  Free software; for complete licensing informa-
       tion, refer to:

       http://cygwin.com/licensing.html

MAINTAINER
       This man page was written  and  is  maintained  by  Joshua
       Daniel Franklin, joshuadfranklin@yahoo.com

SEE ALSO
       The  full documentation to the Cygwin API is maintained on
       the web at:

       http://cygwin.com/cygwin-api/cygwin-api.html

       The website is updated more frequently than the man  pages
       and  should  be  considered  the  authoritative  source of
       information.

2002 Apr 12                          CYGWIN_CONV_TO_POSIX_PATH(3)

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2002-04-22 21:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-22 11:30 small inter-operability patch for vim 6.1.2 for Cygwin Chris Metcalf
2002-04-22 12:08 ` Bram Moolenaar
2002-04-22 12:14   ` Chris Metcalf
2002-04-22 12:26     ` Corinna Vinschen
2002-04-22 12:18   ` Corinna Vinschen
2002-04-22 12:31     ` Bram Moolenaar
2002-04-22 12:39       ` small inter-operability patch for vim 6.1.2 for cygwin Christopher Faylor
2002-04-22 14:35         ` Michael A Chase
2002-04-22 14:53           ` Christopher Faylor
2002-04-22 15:27             ` Michael A Chase
2002-04-22 15:30               ` Christopher Faylor
2002-04-22 12:41       ` small inter-operability patch for vim 6.1.2 for Cygwin Corinna Vinschen
2002-04-22 12:44       ` Chris Metcalf
2002-04-22 13:48         ` Bram Moolenaar
2002-04-22 12:41 small inter-operability patch for vim 6.1.2 for cygwin Richard Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).