diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 03:17:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 03:17:06 -0400 |
commit | 1d3fe4a75b691285cded47c9f1a91b30d25287b0 (patch) | |
tree | d967425c1e961133ff0df98b986e81fae9162ba7 /scripts/kconfig/symbol.c | |
parent | 664a41b8a91bf78a01a751e15175e0008977685a (diff) | |
parent | 2a11c8ea20bf850b3a2c60db8c2e7497d28aba99 (diff) |
Merge branch 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6
* 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild-2.6: (25 commits)
kconfig: Introduce IS_ENABLED(), IS_BUILTIN() and IS_MODULE()
xconfig: Abort close if configuration cannot be saved
kconfig: fix missing "0x" prefix from S_HEX symbol in autoconf.h
kconfig/nconf: remove useless conditionnal
kconfig/nconf: prevent segfault on empty menu
kconfig/nconf: use the generic menu_get_ext_help()
nconfig: Avoid Wunused-but-set warning
kconfig/conf: mark xfgets() private
kconfig: remove pending prototypes for kconfig_load()
kconfig/conf: add command line options' description
kconfig/conf: reduce the scope of `defconfig_file'
kconfig: use calloc() for expr allocation
kconfig: introduce specialized printer
kconfig: do not overwrite symbol direct dependency in assignment
kconfig/gconf: silent missing prototype warnings
kconfig/gconf: kill deadcode
kconfig: nuke LKC_DIRECT_LINK cruft
kconfig: nuke reference to SWIG
kconfig: add missing <stdlib.h> inclusion
kconfig: add missing <ctype.h> inclusion
...
Fix up conflicts in scripts/kconfig/Makefile
Diffstat (limited to 'scripts/kconfig/symbol.c')
-rw-r--r-- | scripts/kconfig/symbol.c | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c index a796c95fe8a0..071f00c3046e 100644 --- a/scripts/kconfig/symbol.c +++ b/scripts/kconfig/symbol.c | |||
@@ -9,7 +9,6 @@ | |||
9 | #include <regex.h> | 9 | #include <regex.h> |
10 | #include <sys/utsname.h> | 10 | #include <sys/utsname.h> |
11 | 11 | ||
12 | #define LKC_DIRECT_LINK | ||
13 | #include "lkc.h" | 12 | #include "lkc.h" |
14 | 13 | ||
15 | struct symbol symbol_yes = { | 14 | struct symbol symbol_yes = { |
@@ -751,7 +750,8 @@ const char *sym_get_string_value(struct symbol *sym) | |||
751 | case no: | 750 | case no: |
752 | return "n"; | 751 | return "n"; |
753 | case mod: | 752 | case mod: |
754 | return "m"; | 753 | sym_calc_value(modules_sym); |
754 | return (modules_sym->curr.tri == no) ? "n" : "m"; | ||
755 | case yes: | 755 | case yes: |
756 | return "y"; | 756 | return "y"; |
757 | } | 757 | } |
@@ -893,6 +893,49 @@ const char *sym_expand_string_value(const char *in) | |||
893 | return res; | 893 | return res; |
894 | } | 894 | } |
895 | 895 | ||
896 | const char *sym_escape_string_value(const char *in) | ||
897 | { | ||
898 | const char *p; | ||
899 | size_t reslen; | ||
900 | char *res; | ||
901 | size_t l; | ||
902 | |||
903 | reslen = strlen(in) + strlen("\"\"") + 1; | ||
904 | |||
905 | p = in; | ||
906 | for (;;) { | ||
907 | l = strcspn(p, "\"\\"); | ||
908 | p += l; | ||
909 | |||
910 | if (p[0] == '\0') | ||
911 | break; | ||
912 | |||
913 | reslen++; | ||
914 | p++; | ||
915 | } | ||
916 | |||
917 | res = malloc(reslen); | ||
918 | res[0] = '\0'; | ||
919 | |||
920 | strcat(res, "\""); | ||
921 | |||
922 | p = in; | ||
923 | for (;;) { | ||
924 | l = strcspn(p, "\"\\"); | ||
925 | strncat(res, p, l); | ||
926 | p += l; | ||
927 | |||
928 | if (p[0] == '\0') | ||
929 | break; | ||
930 | |||
931 | strcat(res, "\\"); | ||
932 | strncat(res, p++, 1); | ||
933 | } | ||
934 | |||
935 | strcat(res, "\""); | ||
936 | return res; | ||
937 | } | ||
938 | |||
896 | struct symbol **sym_re_search(const char *pattern) | 939 | struct symbol **sym_re_search(const char *pattern) |
897 | { | 940 | { |
898 | struct symbol *sym, **sym_arr = NULL; | 941 | struct symbol *sym, **sym_arr = NULL; |