tar: prevent few prefix edge cases and simplify logic.