]> git.webhop.me Git - lcd4linux.git/commitdiff
add octal escape sequences to evaluator
authormichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 29 Jan 2009 06:21:40 +0000 (06:21 +0000)
committermichael <michael@3ae390bd-cb1e-0410-b409-cd5a39f66f1f>
Thu, 29 Jan 2009 06:21:40 +0000 (06:21 +0000)
git-svn-id: https://ssl.bulix.org/svn/lcd4linux/trunk@981 3ae390bd-cb1e-0410-b409-cd5a39f66f1f

evaluator.c

index 52212b35f5401f56f1c6720e8a00f03ce3c13941..7626d0109f2b45c26b6bf83397c6fc26451f9542 100644 (file)
@@ -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++;