Fixed ntpath.expandvars to not replace references to non-existing
variables with nothing.  Also added tests.
This fixes bug #494589.
diff --git a/Lib/test/test_posixpath.py b/Lib/test/test_posixpath.py
index 3984157..20a1fc5 100644
--- a/Lib/test/test_posixpath.py
+++ b/Lib/test/test_posixpath.py
@@ -374,6 +374,8 @@
             self.assertEqual(posixpath.expandvars("$foo}bar"), "bar}bar")
             self.assertEqual(posixpath.expandvars("${foo"), "${foo")
             self.assertEqual(posixpath.expandvars("${{foo}}"), "baz1}")
+            self.assertEqual(posixpath.expandvars("$foo$foo"), "barbar")
+            self.assertEqual(posixpath.expandvars("$bar$bar"), "$bar$bar")
         finally:
             os.environ.clear()
             os.environ.update(oldenv)