Introduce "base_name_compare()" helper function