apply a non-empty string for path components which are empty - fixes #78...

...71

@whitehairtong @icewind1991 @bantu THX