rem: iter->cur_header = hdrs; iter->cur_path = strdup(path);
add: iter->current_header = hdrs; iter->current_path = strdup(path);
context: module_traverse_dir(module_iterator *iter){	struct stat st;	char buffer[SYS_MAX_NAME_LEN + sizeof(struct dirent)];	struct dirent *dirent = (struct dirent *)buffer;	char path[SYS_MAX_PATH_LEN];	int res;	/* If (*iter->cur_header) != NULL we have another module within	 * the existing file to return, so just return.	 * Otherwise, actually find the next file to read.	 */ 	if (iter->cur_header) {		if (*iter->cur_header != NULL)			return B_OK;		unload_module_file(iter->cur_path);	}	SHOW_FLOW( 3, "scanning %s\n", iter->cur_dir->name);	if ((res = sys_read_dir(iter->cur_dir->file, dirent, sizeof(buffer), 1)) <= 0) {		SHOW_FLOW(3, "got error: %s\n", strerror(res));		module_leave_dir(iter);		return B_NO_ERROR;	}	SHOW_FLOW(3, "got %s\n", dirent->d_name);	if (strcmp(dirent->d_name, ".") == 0		|| strcmp(dirent->d_name, "..") == 0 )		return B_NO_ERROR;	compose_path(path, iter, dirent->d_name, true);	/* As we're doing a new file, reset the pointers that might get	 * screwed up...	 */	iter->cur_header = NULL;	iter->module_pos = 0;	if ((res = stat(path, &st)) != B_NO_ERROR)		return res;	if (S_ISREG(st.st_mode)) {		module_info **hdrs = NULL;		if ((hdrs = load_module_file(path)) != NULL) {			iter->cur_header = hdrs;			iter->cur_path = strdup(path);						return B_NO_ERROR;		}		return EINVAL; /* not sure what we should return here */	}	if (S_ISDIR(st.st_mode))		return module_enter_dir(iter, path);	SHOW_FLOW(3, "entry %s not a file nor a directory - ignored\n", dirent->d_name);	return B_NO_ERROR;}