diff options
author | John Wiegley <johnw@newartisans.com> | 2009-06-28 16:00:29 +0100 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-06-28 16:00:29 +0100 |
commit | bad1b1368031ce0b1de1517ca696d83351941eed (patch) | |
tree | b3e1db1a9984b7a4fee2f7e201b76436d019f7bd /src/value.cc | |
parent | b90ec255221a90f34d313b7f3433e7d686a7b1c9 (diff) | |
download | fork-ledger-bad1b1368031ce0b1de1517ca696d83351941eed.tar.gz fork-ledger-bad1b1368031ce0b1de1517ca696d83351941eed.tar.bz2 fork-ledger-bad1b1368031ce0b1de1517ca696d83351941eed.zip |
value_t::dump now faithfully represents strings
Diffstat (limited to 'src/value.cc')
-rw-r--r-- | src/value.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/value.cc b/src/value.cc index b19ad956..702b889e 100644 --- a/src/value.cc +++ b/src/value.cc @@ -1591,7 +1591,21 @@ void value_t::dump(std::ostream& out, const bool relaxed) const break; case STRING: - out << '"' << as_string() << '"'; + out << '"'; + foreach (const char& ch, as_string()) { + switch (ch) { + case '"': + out << "\\\""; + break; + case '\\': + out << "\\\\"; + break; + default: + out << ch; + break; + } + } + out << '"'; break; case MASK: |