diff options
author | John Wiegley <johnw@newartisans.com> | 2009-10-31 03:07:28 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-10-31 03:07:28 -0400 |
commit | e182f01de169d3d3daa76fd6d80220198b9d014f (patch) | |
tree | bb6f9ab9f8bd374968ad1c7a7de1330673298b26 /src/utils.h | |
parent | b0f12c600c8080d11d8f514aa7d4149323da6803 (diff) | |
download | fork-ledger-e182f01de169d3d3daa76fd6d80220198b9d014f.tar.gz fork-ledger-e182f01de169d3d3daa76fd6d80220198b9d014f.tar.bz2 fork-ledger-e182f01de169d3d3daa76fd6d80220198b9d014f.zip |
Parse \n and such in all strings read with READ_INTO
Diffstat (limited to 'src/utils.h')
-rw-r--r-- | src/utils.h | 18 |
1 files changed, 18 insertions, 0 deletions
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<char>(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; \ |