Subject: bug#32304: closed (Re: bug#32304: 27.0.50; tramp-tests issue with double slash)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 10 Aug 2018 07:28:02 +0000

Your bug report

#32304: 27.0.50; tramp-tests issue with double slash

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
32304: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=32304
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#32304: 27.0.50; tramp-tests issue with double slash
From: Michael Albinus <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked]
Date: Fri, 10 Aug 2018 09:27:48 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 27.1

Eli Zaretskii <[email-masked]> writes:

>> Should be fixed now in master. Could you, pls recheck? (I haven't tested
>> on MS Windows today)
>
> Thanks, it works now as expected.

Thanks for checking, I'm closing the bug.

Best regards, Michael.

Subject: 27.0.50; tramp-tests issue with double slash
From: Ken Brown <[email-masked]>
To: [email-masked]
Date: Sun, 29 Jul 2018 11:54:10 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

The following parts of tramp-test04-substitute-in-file-name are failing
on Cygwin (and probably also on MS-Windows, but I can't easily test
that):

(should
    (string-equal
     (substitute-in-file-name "/method:host://foo") "/method:host:/foo"))
(should
    (string-equal (substitute-in-file-name "/method:host:/path///foo") 
"/foo"))
(should
    (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo"))

Here are the corresponding evaluations:

(substitute-in-file-name "/method:host://foo")
"/method:host://foo"

(substitute-in-file-name "/method:host:/path///foo")
"//foo"

(substitute-in-file-name "/method:host://~foo")
"//~foo"

This is a consequence of the fact that Tramp calls
substitute-in-file-name on the local part of the file name:

(substitute-in-file-name "//foo")
"//foo"

(substitute-in-file-name "/path///foo")
"//foo"

(substitute-in-file-name "//~foo")
"//~foo"

"//" has a special meaning at the beginning of a file name on Cygwin and
MS-Windows; see the comment near the beginning of
search_embedded_absfilename.  So I don't think there's a real bug here.
Maybe the expected result of the test should simply be adjusted, as in
the attached patch.  Someone who builds on MS-Windows would have to
check this.

Ken

From 328766e02145fcfcdd54c124ff866ce8f2e15d59 Mon Sep 17 00:00:00 2001
From: Ken Brown <[email-masked]>
Date: Sun, 29 Jul 2018 11:45:26 -0400
Subject: [PATCH] Adjust expected results on a tramp test

* test/lisp/net/tramp-tests.el
(tramp-test04-substitute-in-file-name): Adjust the expected
results on Cygwin and MS-Windows, where "//" at the beginning
of a file name has a special meaning.  (Bug#99999)
---
 test/lisp/net/tramp-tests.el | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/test/lisp/net/tramp-tests.el b/test/lisp/net/tramp-tests.el
index 5c5eff8798..a29df1682c 100644
--- a/test/lisp/net/tramp-tests.el
+++ b/test/lisp/net/tramp-tests.el
@@ -1781,9 +1781,15 @@ tramp--test-print-duration
   (should (string-equal (substitute-in-file-name "/method:host:///foo") "/foo"))
   (should
    (string-equal
-    (substitute-in-file-name "/method:host://foo") "/method:host:/foo"))
+    (substitute-in-file-name "/method:host://foo")
+    (if (memq system-type '(cygwin windows-nt))
+        "/method:host://foo"
+      "/method:host:/foo")))
   (should
-   (string-equal (substitute-in-file-name "/method:host:/path///foo") "/foo"))
+   (string-equal (substitute-in-file-name "/method:host:/path///foo")
+                 (if (memq system-type '(cygwin windows-nt))
+                     "//foo"
+                   "/foo")))
   (should
    (string-equal
     (substitute-in-file-name "/method:host:/path//foo") "/method:host:/foo"))
@@ -1804,7 +1810,10 @@ tramp--test-print-duration
     "/method:host:/:/path//foo"))
 
   (should
-   (string-equal (substitute-in-file-name "/method:host://~foo") "/~foo"))
+   (string-equal (substitute-in-file-name "/method:host://~foo")
+                 (if (memq system-type '(cygwin windows-nt))
+                     "//~foo"
+                   "/~foo")))
   (should
    (string-equal
     (substitute-in-file-name "/method:host:/~foo") "/method:host:/~foo"))
-- 
2.17.0