diff options
author | Mattias Andrée <maandree@operamail.com> | 2014-12-07 16:13:52 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2014-12-07 16:13:52 +0100 |
commit | 8917d7405922da49e438f726f5d537d95615e8eb (patch) | |
tree | a947a589b4364c6ee9d43f12a567de52d6f0f549 /src/mds-kbdc | |
parent | fail_if supports sequences without being double bracketed (diff) | |
download | mds-8917d7405922da49e438f726f5d537d95615e8eb.tar.gz mds-8917d7405922da49e438f726f5d537d95615e8eb.tar.bz2 mds-8917d7405922da49e438f726f5d537d95615e8eb.tar.xz |
mds-kbdc: compile-layout: fix bug in parsing escapes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src/mds-kbdc')
-rw-r--r-- | src/mds-kbdc/compile-layout.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c index 2d7ed04..056191b 100644 --- a/src/mds-kbdc/compile-layout.c +++ b/src/mds-kbdc/compile-layout.c @@ -653,7 +653,7 @@ static char32_t* parse_escape(mds_kbdc_tree_t* restrict tree, const char* restri *escape = 16; else if (R('1', '9')) /* Variable dereference. */ - *escape = 10; + *escape = 10, have = 1, numbuf = (uintmax_t)(c - '0'); else if ((c == '_') || R('a', 'z') || R('A', 'Z')) /* Function call. */ *escape = 100; @@ -666,7 +666,7 @@ static char32_t* parse_escape(mds_kbdc_tree_t* restrict tree, const char* restri /* Function call. */ return parse_function_call(tree, raw_, lineoff, escape, end); /* Octal or hexadecimal representation, or variable dereference. */ - for (; (c = *raw++) && (c != '.'); have = 1) + for (; c = *raw++, c != '.'; have = 1) if (CR(*escape == 8, '0', '7')) numbuf = 8 * numbuf + (c & 15); else if (CR(*escape == 16, '0', '9')) numbuf = 16 * numbuf + (c & 15); else if (CR(*escape == 16, 'a', 'f')) numbuf = 16 * numbuf + (c & 15) + 9; |