mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
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>
This commit is contained in:
parent
e82dae9083
commit
c7abe8630a
1 changed files with 5 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue