GNU bug report logs - #4823
w32 paths `substitute-in-file-name' fails when environmental variable is set for \\ style paths:

Previous Next

Package: emacs;

Reported by: MON KEY <monkey <at> sandpframing.com>

Date: Wed, 28 Oct 2009 20:25:05 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> emacsbugs.donarmstrong.com (full text, mbox):

From: MON KEY <monkey <at> sandpframing.com>
To: bug-gnu-emacs <at> gnu.org
Subject: w32 paths `substitute-in-file-name' fails when environmental variable 
	is set for \\ style paths:
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)




This bug report was last modified 13 years and 324 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.