Subject: Re: patch for bug 7553: duplicate entries in vc-dir-mode (Windows) due to backslash from svn output

From: Vagn Johansen <[email-masked]>
Date: Fri, 25 Feb 2011 19:56:35 +0100

Eli Zaretskii <[email-masked]> writes:

>
> Thanks.
>
> I think this replacement should be limited to MS-Windows and MS-DOS
> systems, because on Posix platforms, the backslash is a valid
> character in a file name.
>

This should do it. Tested on Windows 7 and Debian 6.

diff --git a/lisp/vc/vc-svn.el b/lisp/vc/vc-svn.el
index 20c7689..274c4a9 100644
--- a/lisp/vc/vc-svn.el
+++ b/lisp/vc/vc-svn.el
@@ -174,7 +174,10 @@ If you want to force an empty list of arguments, use t."
     (while (re-search-forward re nil t)
       (let ((state (cdr (assq (aref (match-string 1) 0) state-map)))
             (propstat (cdr (assq (aref (match-string 2) 0) state-map)))
-	    (filename (match-string 4)))
+	    (filename 
+	     (if (memq system-type '(windows-nt ms-dos))
+		 (replace-regexp-in-string "\\\\" "/" (match-string 4))
+	       (match-string 4))))
         (and (memq propstat '(conflict edited))
              (not (eq state 'conflict)) ; conflict always wins
              (setq state propstat))

-- 
Vagn Johansen