diff options
| author | Marco Elver <elver@google.com> | 2022-05-05 14:36:15 +0200 |
|---|---|---|
| committer | Marco Elver <me@marcoelver.com> | 2022-05-05 20:46:02 +0200 |
| commit | a870470cbca3f102233daa7a9c14733261d6a13d (patch) | |
| tree | a5bd2767a89f987efab053e0b02df59f1dcbd7a1 /pkg/kconfig | |
| parent | 06089fcd9240fc0b96df2e842bc5271ba4074134 (diff) | |
pkg/kconfig: accept \n as valid within quoted string
linux-next contains "Kconfig: Add option for asm goto w/ tied outputs to
workaround clang-13 bug", which added this elaborate config variable to
init/Kconfig:
| config CC_HAS_ASM_GOTO_TIED_OUTPUT
| depends on CC_HAS_ASM_GOTO_OUTPUT
| # Detect buggy gcc and clang, fixed in gcc-11 clang-14.
| def_bool $(success,echo 'int foo(int *x) { asm goto (".long (%l[bar]) - .\n": "+m"(*x) ::: bar); return *x; bar: return 0; }' | $CC -x c - -c -o /dev/null)
The current validation in parser.go will complain with "bad quoted
character", because of the '\n' in the quoted string.
Fix it by allowing '\n'.
Diffstat (limited to 'pkg/kconfig')
| -rw-r--r-- | pkg/kconfig/parser.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/kconfig/parser.go b/pkg/kconfig/parser.go index 5fe9bed09..60bfc54a1 100644 --- a/pkg/kconfig/parser.go +++ b/pkg/kconfig/parser.go @@ -142,7 +142,7 @@ func (p *parser) QuotedString() string { if ch == '\\' { ch = p.char() switch ch { - case '\'', '"', '\\': + case '\'', '"', '\\', 'n': str = append(str, ch) default: p.failf("bad quoted character") |
