rem: if (strlcpy(filename, ++p, B_FILE_NAME_LENGTH) >= B_FILE_NAME_LENGTH) return B_NAME_TOO_LONG;  if (p[0] != '\0'){ p[0] = '.'; p[1] = '\0';
add: p++; if (*p == '\0') {  strcpy(filename, "."); } else {  if (strlcpy(filename, p, B_FILE_NAME_LENGTH) >= B_FILE_NAME_LENGTH) { return B_NAME_TOO_LONG; }
context: get_dir_path_and_leaf(char *path, char *filename){	char *p = strrchr(path, '/');		// '/' are not allowed in file names!	FUNCTION(("get_dir_path_and_leaf(path = %s)\n", path));	if (!p) {		// this path is single segment with no '/' in it		// ex. "foo"		if (strlcpy(filename, path, B_FILE_NAME_LENGTH) >= B_FILE_NAME_LENGTH)			return B_NAME_TOO_LONG;		strcpy(path, ".");	} else {		// replace the filename portion of the path with a '.'		if (strlcpy(filename, ++p, B_FILE_NAME_LENGTH) >= B_FILE_NAME_LENGTH)			return B_NAME_TOO_LONG;		if (p[0] != '\0'){			p[0] = '.';			p[1] = '\0';		}	}	return B_OK;}