aboutsummaryrefslogtreecommitdiffstats
path: root/src/mds-kbdc
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-12-11 16:10:17 +0100
committerMattias Andrée <maandree@operamail.com>2014-12-11 16:10:17 +0100
commit791599909ebbfd6fa9637d8d4cc937205e67b045 (patch)
tree462d2348c72c9496e2ccb78a93526c7935d3c8d8 /src/mds-kbdc
parentsome small fixes (diff)
downloadmds-791599909ebbfd6fa9637d8d4cc937205e67b045.tar.gz
mds-791599909ebbfd6fa9637d8d4cc937205e67b045.tar.bz2
mds-791599909ebbfd6fa9637d8d4cc937205e67b045.tar.xz
mds-kbdc: minor bug fixes
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/mds-kbdc/compile-layout.c3
-rw-r--r--src/mds-kbdc/raw-data.c4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/mds-kbdc/compile-layout.c b/src/mds-kbdc/compile-layout.c
index 007f6ae..dc4fa75 100644
--- a/src/mds-kbdc/compile-layout.c
+++ b/src/mds-kbdc/compile-layout.c
@@ -524,7 +524,8 @@ static size_t check_function_calls_in_literal_(const mds_kbdc_tree_t* restrict t
if (escape)
{
escape = 0;
- if ((c == '_') || R('a', 'z') || R('A', 'Z'))
+ if (((c == '_') || R('a', 'z') || R('A', 'Z')) &&(c != 'u'))
+ /* \u*() is disallowed because \u* is used for hexadecimal representation. */
if (check_function_call(tree, raw - 2, lineoff + (size_t)(raw - 2 - raw_), &raw, rc), *rc < 0)
break;
}
diff --git a/src/mds-kbdc/raw-data.c b/src/mds-kbdc/raw-data.c
index d8976ec..995eb79 100644
--- a/src/mds-kbdc/raw-data.c
+++ b/src/mds-kbdc/raw-data.c
@@ -360,9 +360,9 @@ static int expand(char** restrict content, size_t* restrict content_size)
/* Expand tab spaces. */
memmove(data + extra, data, n);
for (ptr = 0; ptr < n; ptr++, added--)
- if (data[ptr] == '\n')
+ if (data[ptr + extra] == '\n')
data[ptr + added++] = data[ptr + extra], col = 0;
- else if (data[ptr] != '\t')
+ else if (data[ptr + extra] != '\t')
data[ptr + added++] = data[ptr + extra], col++;
else
do