primary_pathname
ret = primary_pathname(residual, &primary_path);
ret = primary_pathname(dirname, &primary_path);