1.1 --- a/kconfig/util.c Fri Oct 17 12:47:53 2008 +0000
1.2 +++ b/kconfig/util.c Tue Jan 22 00:34:15 2013 +0100
1.3 @@ -12,15 +12,18 @@
1.4 struct file *file_lookup(const char *name)
1.5 {
1.6 struct file *file;
1.7 + const char *file_name = sym_expand_string_value(name);
1.8
1.9 for (file = file_list; file; file = file->next) {
1.10 - if (!strcmp(name, file->name))
1.11 + if (!strcmp(name, file->name)) {
1.12 + free((void *)file_name);
1.13 return file;
1.14 + }
1.15 }
1.16
1.17 file = malloc(sizeof(*file));
1.18 memset(file, 0, sizeof(*file));
1.19 - file->name = strdup(name);
1.20 + file->name = file_name;
1.21 file->next = file_list;
1.22 file_list = file;
1.23 return file;
1.24 @@ -46,8 +49,8 @@
1.25 else
1.26 fprintf(out, "\t%s\n", file->name);
1.27 }
1.28 - fprintf(out, "\ninclude/config/auto.conf: \\\n"
1.29 - "\t$(deps_config)\n\n");
1.30 + fprintf(out, "\n%s: \\\n"
1.31 + "\t$(deps_config)\n\n", conf_get_autoconfig_name());
1.32
1.33 expr_list_for_each_sym(sym_env_list, e, sym) {
1.34 struct property *prop;
1.35 @@ -61,7 +64,7 @@
1.36 if (!value)
1.37 value = "";
1.38 fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value);
1.39 - fprintf(out, "include/config/auto.conf: FORCE\n");
1.40 + fprintf(out, "%s: FORCE\n", conf_get_autoconfig_name());
1.41 fprintf(out, "endif\n");
1.42 }
1.43
1.44 @@ -72,12 +75,13 @@
1.45 }
1.46
1.47
1.48 -/* Allocate initial growable sting */
1.49 +/* Allocate initial growable string */
1.50 struct gstr str_new(void)
1.51 {
1.52 struct gstr gs;
1.53 gs.s = malloc(sizeof(char) * 64);
1.54 gs.len = 64;
1.55 + gs.max_width = 0;
1.56 strcpy(gs.s, "\0");
1.57 return gs;
1.58 }
1.59 @@ -88,6 +92,7 @@
1.60 struct gstr gs;
1.61 gs.s = strdup(s);
1.62 gs.len = strlen(s) + 1;
1.63 + gs.max_width = 0;
1.64 return gs;
1.65 }
1.66