Subject: w32 paths `substitute-in-file-name' fails when environmental variable is set for \\ style paths:
From: MON KEY <[email-masked]>
To: [email-masked]
Date: Wed, 28 Oct 2009 16:19:44 -0400

w32 paths `substitute-in-file-name' fails when environmental variable
is set for \\ style paths:

;; :SITUATION-1 w/out trailing `\\'
(setenv "HOME2" "C:\\home\\me")
(getenv "HOME2")
;=> "C:\\home\\me"
(substitute-in-file-name "$HOME2\\.emacs")
;=> "C:\\home\\me/emacs"
(substitute-in-file-name "$HOME2/.emacs")
;=>"C:\\home\\me/.emacs"
(substitute-in-file-name "$HOME2.emacs")
;=> "C:\\home\\me.emacs"

;; :SITUATION-2 with trailing `\\'
(setenv "HOME2" "C:\\home\\me\\")
(getenv "HOME2")
;=> "C:\\home\\me\\"
(substitute-in-file-name "$HOME2\\.emacs")
;=> "/.emacs"
(substitute-in-file-name "$HOME2\.emacs")
;=> "C:\\home\\me\\.emacs"
(substitute-in-file-name "$HOME2//.emacs")
;=> "/.emacs"
(substitute-in-file-name "$HOME2.emacs")
;=> "C:\\home\\me\\.emacs"

;; ON FOLLOWING SYSTEM:
GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-06-30 on LENNART-69DE564 (patched)