fix($location): don't clobber path during parsing of path

Closes #7199