/* Released under the terms of the GNU GPL v2.0.  */
struct file* file_lookup(const char *name)
/* Released under the terms of the GNU GPL v2.0.  */
struct file* file_lookup(const char *name)
{
	struct file *file;
	char *file_name = sym_expand_string_value(name);
	for (file = file_list; file; file = file->next) {
		if (!strcmp(name, file->name)) {
			free(file_name);
			return file;
		}
	}
	file = xmalloc(sizeof(*file));
	memset(file, 0, sizeof(*file));
	file->name = file_name;
	file->next = file_list;
	file_list = file;
	return file;
}