summaryrefslogtreecommitdiff
path: root/csv.cc
diff options
context:
space:
mode:
Diffstat (limited to 'csv.cc')
-rw-r--r--csv.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/csv.cc b/csv.cc
index 4a8c1157..d3c3faf7 100644
--- a/csv.cc
+++ b/csv.cc
@@ -3,10 +3,10 @@
namespace ledger {
namespace {
- inline void write_escaped_string(std::ostream& out, const std::string& xact)
+ inline void write_escaped_string(std::ostream& out, const string& xact)
{
out << "\"";
- for (std::string::const_iterator i = xact.begin(); i != xact.end(); i++)
+ for (string::const_iterator i = xact.begin(); i != xact.end(); i++)
if (*i == '"') {
out << "\\";
out << "\"";
@@ -87,7 +87,8 @@ void format_csv_transactions::operator()(transaction_t& xact)
}
out << ',';
- write_escaped_string(out, xact.entry->code);
+ if (xact.entry->code)
+ write_escaped_string(out, *xact.entry->code);
out << ',';
{