Subject: | Home Dir Substitution Broken on Windows |
Date: | Mon, 23 Jun 2014 22:39:47 -0700 |
To: | bug-config-gitlike [...] rt.cpan.org |
From: | "David E. Wheeler" <dwheeler [...] cpan.org> |
I see that there are always test failures on Windows right now:
http://www.cpantesters.org/distro/C/Config-GitLike.html?oncpan=1&distmat=1&version=1.14
But working with 1.12, which is available on ActivePerl PPM, there is this bug, and it appears to also be present in the current repo:
$filename =~ s/^~/$ENV{'HOME'}/g;
That does not work on Windows for two reasons:
1. $ENV{HOME} is not set. $ENV{HOMEPATH} is, though.
2. ~ is used for DOS paths on Windows, not the home directory.
So if I tell it the path is "C:\DOCUME~1\foo\bar", the above substitution changes it to "C:\DOCUME1\foo\bar", which of course is wrong.
So in truth, I don't think you want to do that at all on Windows -- or on any other platform where "~" does not mean HOME.
Best,
David
Message body not shown because it is not plain text.