aboutsummaryrefslogtreecommitdiffstats
path: root/evaluator.c
diff options
context:
space:
mode:
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-01-29 06:21:40 +0000
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>2009-01-29 06:21:40 +0000
commitb66426fa0075250c9fac8bdae2d5b19ed802f76a (patch)
tree9d5d6641afad04b588b76c60eac820592f421374 /evaluator.c
parent4ad1d16232b521c117321dacdd73aeae072de5c8 (diff)
downloadlcd4linux-b66426fa0075250c9fac8bdae2d5b19ed802f76a.tar.gz
add octal escape sequences to evaluator
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@981 3ae390bd-cb1e-0410-b409-cd5a39f66f1f
Diffstat (limited to 'evaluator.c')
-rw-r--r--evaluator.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/evaluator.c b/evaluator.c
index 52212b3..7626d01 100644
--- a/evaluator.c
+++ b/evaluator.c
@@ -631,6 +631,21 @@ static void Parse(void)
Word[length++] = '\r';
ExprPtr += 2;
break;
+ case '0':
+ case '1':
+ case '2':
+ case '3':
+ if (*(ExprPtr + 2) >= '0' && *(ExprPtr + 2) <= '7' &&
+ *(ExprPtr + 3) >= '0' && *(ExprPtr + 3) <= '7') {
+ Word[length++] =
+ (*(ExprPtr + 1) - '0') * 64 + (*(ExprPtr + 2) - '0') * 8 + (*(ExprPtr + 3) - '0');
+ ExprPtr += 4;
+ } else {
+ error("Evaluator: illegal octal sequence '\\%c%c%c' in <%s>",
+ *(ExprPtr + 1), *(ExprPtr + 2), *(ExprPtr + 3), Expression);
+ Word[length++] = *ExprPtr++;
+ }
+ break;
default:
error("Evaluator: unknown escape sequence '\\%c' in <%s>", *(ExprPtr + 1), Expression);
Word[length++] = *ExprPtr++;