summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2012-09-01 07:52:54 +0000
committerEli Zaretskii <eliz@gnu.org>2012-09-01 07:52:54 +0000
commit6cb5be7813d4f7e9380929f900a6cbbb0e6756c6 (patch)
treef50bb7579c83f0d477d9457cdb6372a710da7369
parentadb50bd4c92424e7281156e118a687da1c8ebd7f (diff)
downloadgunmake-6cb5be7813d4f7e9380929f900a6cbbb0e6756c6.tar.gz
Fix unescape_char when not unescaping.
read.c (unescape_char): Advance 'p' after copying the unescaped characters. Otherwise the backslashes are incorrectly erased from the original string.
-rw-r--r--ChangeLog6
-rw-r--r--read.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e5e237..99e75bc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-09-01 Eli Zaretskii <eliz@gnu.org>
+
+ * read.c (unescape_char): Advance 'p' after copying the unescaped
+ characters. Otherwise the backslashes are incorrectly erased from
+ the original string.
+
2012-03-05 Paul Smith <psmith@gnu.org>
Update copyright notices to use year ranges, as allowed by
diff --git a/read.c b/read.c
index 33bf119..f075ef5 100644
--- a/read.c
+++ b/read.c
@@ -2242,9 +2242,9 @@ unescape_char (char *string, int c)
/* It is, and there's >1 backslash. Take half of them. */
l /= 2;
memcpy (p, s, l);
- p += l;
}
s = e;
+ p += l;
}
*(p++) = *(s++);