From e5335b7401bedc87ffb9d031c0fff6049fac2a85 Mon Sep 17 00:00:00 2001 From: Jesse Thilo Date: Sun, 18 Apr 1999 15:17:30 +0000 Subject: [PATCH] (literalchar): fixed the code for escaping double quotes (thanks Jonathan Czisny.) --- src/lex.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lex.c b/src/lex.c index 627a0bac..3a51c974 100644 --- a/src/lex.c +++ b/src/lex.c @@ -271,7 +271,9 @@ literalchar (char **pp, int *pcode, char term) so that `\012' and `\n' can be interchangeable. */ p = *pp; - if (code == '\\') {*p++ = '\\'; *p++ = '\\';} + if (code == term && wasquote) + *p++ = code; + else if (code == '\\') {*p++ = '\\'; *p++ = '\\';} else if (code == '\'') {*p++ = '\\'; *p++ = '\'';} else if (code == '\"') {*p++ = '\\'; *p++ = '\"';} else if (code >= 040 && code < 0177) -- 2.45.2