From e182f01de169d3d3daa76fd6d80220198b9d014f Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Sat, 31 Oct 2009 03:07:28 -0400 Subject: Parse \n and such in all strings read with READ_INTO --- src/utils.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/utils.h') diff --git a/src/utils.h b/src/utils.h index c662acbe..cdb43037 100644 --- a/src/utils.h +++ b/src/utils.h @@ -580,6 +580,15 @@ inline char peek_next_nonws(std::istream& in) { str.get(var); \ if (in.eof()) \ break; \ + switch (var) { \ + case 'b': var = '\b'; break; \ + case 'f': var = '\f'; break; \ + case 'n': var = '\n'; break; \ + case 'r': var = '\r'; break; \ + case 't': var = '\t'; break; \ + case 'v': var = '\v'; break; \ + default: break; \ + } \ } \ *_p++ = var; \ var = static_cast(str.peek()); \ @@ -600,6 +609,15 @@ inline char peek_next_nonws(std::istream& in) { str.get(var); \ if (in.eof()) \ break; \ + switch (var) { \ + case 'b': var = '\b'; break; \ + case 'f': var = '\f'; break; \ + case 'n': var = '\n'; break; \ + case 'r': var = '\r'; break; \ + case 't': var = '\t'; break; \ + case 'v': var = '\v'; break; \ + default: break; \ + } \ idx++; \ } \ *_p++ = var; \ -- cgit v1.2.3