def previous_or_current_path(current_path: str, previous_path: str) -> str:
    """ Return previous path only if the current path is used as a pointer
        to the contents of the previous path.
    """

    return (previous_path
            if (current_path is not None and current_path.strip() == '^')
            else current_path)