Skip to content

Commit

Permalink
kconfig: expand file names
Browse files Browse the repository at this point in the history
This will allow to use the following construct in source files:

config FOO
    string
    default "foo"

source "$FOO/Kconfig"

Signed-off-by: Arnaud Lacombe <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Reviewed-by: Michal Marek <[email protected]>
  • Loading branch information
lacombar committed Sep 20, 2010
1 parent e82dae9 commit c7abe86
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions scripts/kconfig/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,18 @@
struct file *file_lookup(const char *name)
{
struct file *file;
const char *file_name = sym_expand_string_value(name);

for (file = file_list; file; file = file->next) {
if (!strcmp(name, file->name))
if (!strcmp(name, file->name)) {
free((void *)file_name);
return file;
}
}

file = malloc(sizeof(*file));
memset(file, 0, sizeof(*file));
file->name = strdup(name);
file->name = file_name;
file->next = file_list;
file_list = file;
return file;
Expand Down

0 comments on commit c7abe86

Please sign in to comment.