Fix logic bug with Windows path handling.

Fixes bug when a path contains different slash types
in same path, e.g. C:/foo\bar.