From c5ba36e1915d2fdb85c66d12209bc1bef51ae648 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Mon, 14 Mar 2011 20:37:17 +0000 Subject: [PATCH] improve SWI and ISO scanner compatibility. --- C/scanner.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/C/scanner.c b/C/scanner.c index 8aed81aa4..aa564d0f3 100755 --- a/C/scanner.c +++ b/C/scanner.c @@ -372,9 +372,9 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream) ch = getchrq(inp_stream); if (ch == '?') {/* delete character */ return 127; - } else if (ch >= 'a' && ch < 'z') {/* octal */ + } else if (ch >= 'a' && ch < 'z') {/* hexa */ return ch - 'a'; - } else if (ch >= 'A' && ch < 'Z') {/* octal */ + } else if (ch >= 'A' && ch < 'Z') {/* hexa */ return ch - 'A'; } else { return '^'; @@ -389,7 +389,8 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream) case '6': case '7': /* character in octal: maximum of 3 digits, terminates with \ */ - if (yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) { + /* follow ISO */ + if (TRUE || yap_flags[CHARACTER_ESCAPE_FLAG] == ISO_CHARACTER_ESCAPES) { unsigned char so_far = ch-'0'; ch = getchrq(inp_stream); if (ch >= '0' && ch < '8') {/* octal */ @@ -401,6 +402,7 @@ read_quoted_char(int *scan_nextp, IOSTREAM *inp_stream) if (ch != '\\') { return send_error_message("invalid octal escape sequence"); } + return so_far; } else if (ch == '\\') { return so_far; } else {