diff options
| author | Arnaud Lacombe <lacombar@gmail.com> | 2010-09-04 16:11:26 -0400 |
|---|---|---|
| committer | Arnaud Lacombe <lacombar@gmail.com> | 2010-09-19 22:54:07 -0400 |
| commit | c7abe8630ae63e90c2267c2c385a682e729e08be (patch) | |
| tree | 73324b002283d95bcaf7f8af53a41a5c3eb910ce /scripts/kconfig/util.c | |
| parent | e82dae9083c8ca97c0f6ba1f5d09591aff67bb4e (diff) | |
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>
Diffstat (limited to 'scripts/kconfig/util.c')
| -rw-r--r-- | scripts/kconfig/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c index 78b5c04e736b..6330cc871a47 100644 --- a/scripts/kconfig/util.c +++ b/scripts/kconfig/util.c | |||
| @@ -12,15 +12,18 @@ | |||
| 12 | struct file *file_lookup(const char *name) | 12 | struct file *file_lookup(const char *name) |
| 13 | { | 13 | { |
| 14 | struct file *file; | 14 | struct file *file; |
| 15 | const char *file_name = sym_expand_string_value(name); | ||
| 15 | 16 | ||
| 16 | for (file = file_list; file; file = file->next) { | 17 | 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); | ||
| 18 | return file; | 20 | return file; |
| 21 | } | ||
| 19 | } | 22 | } |
| 20 | 23 | ||
| 21 | file = malloc(sizeof(*file)); | 24 | file = malloc(sizeof(*file)); |
| 22 | memset(file, 0, sizeof(*file)); | 25 | memset(file, 0, sizeof(*file)); |
| 23 | file->name = strdup(name); | 26 | file->name = file_name; |
| 24 | file->next = file_list; | 27 | file->next = file_list; |
| 25 | file_list = file; | 28 | file_list = file; |
| 26 | return file; | 29 | return file; |
