summaryrefslogtreecommitdiff
path: root/kconfig/util.c
diff options
context:
space:
mode:
authorChris Packham <judge.packham@gmail.com>2020-12-10 07:33:11 (GMT)
committerChris Packham <judge.packham@gmail.com>2021-02-02 07:06:32 (GMT)
commit07ae8dd48dfb19a7b89bc4c208bc5778c79ce446 (patch)
tree888ba269c7ed39b49015489ffdcc9da15d7ad2c8 /kconfig/util.c
parent51cb8939f830584b5b0db4f018dfa73e311308f6 (diff)
kconfig: Sync with upstream v4.16
This commit introduces the following upstream changes: 5ae6fcc4bb82 kconfig: fix line number in recursive inclusion error message 1a90ce36c6ef kconfig: Update ncurses package names for menuconfig bf0bbdcf1003 kconfig: Don't leak choice names during parsing f4bc1eefc160 kconfig: set SYMBOL_AUTO to the symbol marked with defconfig_list cd81fc82b93f kconfig: add xstrdup() helper 523ca58b7db2 kconfig: remove const qualifier from sym_expand_string_value() d717f24d8c68 kconfig: add xrealloc() helper 9e3e10c72536 kconfig: send error messages to stderr f3ff6fb5db68 kconfig: echo stdin to stdout if either is redirected d2a04648a5db kconfig: remove check_stdin() cd58a91def2a kconfig: remove 'config*' pattern from .gitignnore 4f208f392103 kconfig: show '?' prompt even if no help text is available cb67ab2cd2b8 kconfig: do not write choice values when their dependency becomes n 1b9eda2e4892 kconfig: Warn if help text is blank cedd55d49dee kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help 1ccb27143360 kconfig: make "Selected by:" and "Implied by:" readable 312ee68752fa kconfig: announce removal of oldnoconfig if used d0fd0428ecf0 kconfig: fix make xconfig when gettext is missing b53688014e33 kconfig: Clarify menu and 'if' dependency propagation 9d1a9e8bc18b kconfig: Document 'if' flattening logic d3465af60f44 kconfig: Clarify choice dependency propagation 3e41ba05b6d6 kconfig: Document SYMBOL_OPTIONAL logic 765f4cdef6f8 kconfig: use default 'yy' prefix for lexer and parser 84dd95d4f87a kconfig: make conf_unsaved a local variable of conf_read() 5a3dc717b3c7 kconfig: make xfgets() really static 52e58a3caeba kconfig: make input_mode static 6479f327dea6 kconfig: Warn if there is more than one help text b92d804a5179 kconfig: drop 'boolean' keyword df60f4b92d3d kconfig: Remove menu_end_entry() 0735f7e5def2 kconfig: Document important expression functions 05cccce58045 kconfig: Document automatic submenu creation code 7cf33f88e294 kconfig: Fix choice symbol expression leak 5b1374b3b3c2 kconfig: Fix expr_free() E_NOT leak ae7440ef0c80 kconfig: Fix automatic menu creation mem leak 0724a7c32a54 kconfig: Don't leak main menus during parsing bc28fe1d5ede kconfig: Don't leak 'option' arguments during parsing 24161a6711c9 kconfig: Don't leak 'source' filenames during parsing 26e47a3c11a2 kconfig: Don't leak symbol names during parsing 29c833061c1d kconfig: generate lexer and parser during build instead of shipping e3b03bf29d6b kconfig: display recursive dependency resolution hint just once f77850d3fe0c kconfig: Clean up modules handling and fix crash fa8cedaef814 kconfig: Clarify expression rewriting 9a826842ff2f kconfig: Rename menu_check_dep() to rewrite_m() c873443430eb kconfig: Sync zconf.y with zconf.tab.c_shipped 52aede4ba5ef kconfig: Document the 'symbol' struct 33ca1a248663 kconfig: Document the 'menu' struct 2c37e08464a8 kconfig: Warn if choice default is not in choice Signed-off-by: Chris Packham <judge.packham@gmail.com>
Diffstat (limited to 'kconfig/util.c')
-rw-r--r--kconfig/util.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/kconfig/util.c b/kconfig/util.c
index 0e76042..c6f6e21 100644
--- a/kconfig/util.c
+++ b/kconfig/util.c
@@ -14,11 +14,11 @@
struct file *file_lookup(const char *name)
{
struct file *file;
- const char *file_name = sym_expand_string_value(name);
+ char *file_name = sym_expand_string_value(name);
for (file = file_list; file; file = file->next) {
if (!strcmp(name, file->name)) {
- free((void *)file_name);
+ free(file_name);
return file;
}
}
@@ -104,7 +104,7 @@ void str_append(struct gstr *gs, const char *s)
if (s) {
l = strlen(gs->s) + strlen(s) + 1;
if (l > gs->len) {
- gs->s = realloc(gs->s, l);
+ gs->s = xrealloc(gs->s, l);
gs->len = l;
}
strcat(gs->s, s);
@@ -145,3 +145,23 @@ void *xcalloc(size_t nmemb, size_t size)
fprintf(stderr, "Out of memory.\n");
exit(1);
}
+
+void *xrealloc(void *p, size_t size)
+{
+ p = realloc(p, size);
+ if (p)
+ return p;
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+}
+
+char *xstrdup(const char *s)
+{
+ char *p;
+
+ p = strdup(s);
+ if (p)
+ return p;
+ fprintf(stderr, "Out of memory.\n");
+ exit(1);
+}