From: michael Date: Thu, 29 Jan 2009 06:21:40 +0000 (+0000) Subject: add octal escape sequences to evaluator X-Git-Tag: svn1203~222 X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=b66426fa0075250c9fac8bdae2d5b19ed802f76a;p=lcd4linux.git add octal escape sequences to evaluator git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@981 3ae390bd-cb1e-0410-b409-cd5a39f66f1f --- 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++;