foo.h:
class Foo
{
void Bar()
{
CPath p(_T("%SYSTEMROOT%\\\\some.file"));
p.ExpandEnvStrings();
}
}
Select Bar(), run "Move to implementation".
----- Observed:
void Foo::Bar()
{
CPath p(_T("C:\\Windows\\\\some.file"));
p.ExpandEnvStrings();
}
----- Expected:
My precious platform independent string constants remain platform independent (and precious).
VS 2008, VAX 1738 (also, VAX 1734), XP
Severity: this was part of a larger method, and I caught this only because the compiler was warning about '\\W' being an invalid escape sequence. It would likely slip through all tests. From this POV, I'd rate it "dangerous".