Commit c7abe863 authored by Arnaud Lacombe's avatar 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: default avatarArnaud Lacombe <lacombar@gmail.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarMichal Marek <mmarek@suse.cz>
parent 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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment