Skip to content

Commit c7abe86

Browse files
committed
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: Arnaud Lacombe <lacombar@gmail.com> Reviewed-by: Sam Ravnborg <sam@ravnborg.org> Reviewed-by: Michal Marek <mmarek@suse.cz>
1 parent e82dae9 commit c7abe86

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

‎scripts/kconfig/util.c‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,18 @@
1212
struct file *file_lookup(const char *name)
1313
{
1414
struct file *file;
15+
const char *file_name = sym_expand_string_value(name);
1516

1617
for (file = file_list; file; file = file->next) {
17-
if (!strcmp(name, file->name))
18+
if (!strcmp(name, file->name)) {
19+
free((void *)file_name);
1820
return file;
21+
}
1922
}
2023

2124
file = malloc(sizeof(*file));
2225
memset(file, 0, sizeof(*file));
23-
file->name = strdup(name);
26+
file->name = file_name;
2427
file->next = file_list;
2528
file_list = file;
2629
return file;

0 commit comments

Comments
 (0)