提交 c7abe863 编写于 作者: A Arnaud Lacombe

kconfig: expand file names

This will allow to use the following construct in source files:

config FOO
    string
    default "foo"

source "$FOO/Kconfig"
Signed-off-by: NArnaud Lacombe <lacombar@gmail.com>
Reviewed-by: NSam Ravnborg <sam@ravnborg.org>
Reviewed-by: NMichal Marek <mmarek@suse.cz>
上级 e82dae90
...@@ -12,15 +12,18 @@ ...@@ -12,15 +12,18 @@
struct file *file_lookup(const char *name) struct file *file_lookup(const char *name)
{ {
struct file *file; struct file *file;
const char *file_name = sym_expand_string_value(name);
for (file = file_list; file; file = file->next) { for (file = file_list; file; file = file->next) {
if (!strcmp(name, file->name)) if (!strcmp(name, file->name)) {
free((void *)file_name);
return file; return file;
}
} }
file = malloc(sizeof(*file)); file = malloc(sizeof(*file));
memset(file, 0, sizeof(*file)); memset(file, 0, sizeof(*file));
file->name = strdup(name); file->name = file_name;
file->next = file_list; file->next = file_list;
file_list = file; file_list = file;
return file; return file;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册