diff options
Diffstat (limited to 'csv.cc')
-rw-r--r-- | csv.cc | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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 << ','; { |