Fix partial fix: A slash in pos 0 still led to read access to pathname[-1].