aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y29
1 files changed, 13 insertions, 16 deletions
diff --git a/parse.y b/parse.y
index 73808532ca..9b40b1d147 100644
--- a/parse.y
+++ b/parse.y
@@ -2067,20 +2067,10 @@ read_escape()
case 'x': /* hex constant */
{
- char buf[2];
- int i;
-
- for (i=0; i<2; i++) {
- int cc = nextc();
+ int numlen;
- if (cc == -1) goto eof;
- buf[i] = cc;
- if (!ISXDIGIT(buf[i])) {
- pushback(buf[i]);
- break;
- }
- }
- c = scan_hex(buf, i, &i);
+ c = scan_hex(lex_p, 2, &numlen);
+ lex_p += numlen;
}
return c;
@@ -3595,9 +3585,16 @@ str_extend(list, term)
tokadd(c);
goto loop_again;
case '\\':
- c = read_escape();
- tokadd(c);
- goto loop_again;
+ c = nextc();
+ if (c == -1) return (NODE*)-1;
+ if (c == term) {
+ tokadd(c);
+ }
+ else {
+ tokadd('\\');
+ tokadd(c);
+ }
+ break;
case '{':
if (brace != -1) nest++;
case '\"':