summaryrefslogtreecommitdiff
path: root/src/csv.cc
diff options
context:
space:
mode:
authorJohann Klähn <kljohann@gmail.com>2013-01-18 18:26:03 +0100
committerJohann Klähn <kljohann@gmail.com>2013-01-18 18:26:03 +0100
commitb3b11bed3be9c7a6dcd4a4427eb02fa7d92f34ed (patch)
treecd5008b6a42cd65c9fe668a92e10237fcec335c4 /src/csv.cc
parent83bd3234d32d7a82d583e4f50f8f90837aa15a93 (diff)
parent385cbd25b9905b16a4c7723bb4e5a5813e84aab0 (diff)
downloadfork-ledger-b3b11bed3be9c7a6dcd4a4427eb02fa7d92f34ed.tar.gz
fork-ledger-b3b11bed3be9c7a6dcd4a4427eb02fa7d92f34ed.tar.bz2
fork-ledger-b3b11bed3be9c7a6dcd4a4427eb02fa7d92f34ed.zip
Merge branch 'master' into next
Some commits were on the master branch but not yet on the next branch due to a pull request to master after those two branches diverged. This merge ensures that next ⊇ master.
Diffstat (limited to 'src/csv.cc')
-rw-r--r--src/csv.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/csv.cc b/src/csv.cc
index dbd2dbfe..c7b75712 100644
--- a/src/csv.cc
+++ b/src/csv.cc
@@ -166,7 +166,7 @@ xact_t * csv_reader::read_xact(bool rich_data)
string total;
string field;
- while (instr.good() && ! instr.eof()) {
+ while (instr.good() && ! instr.eof() && n < index.size()) {
field = read_field(instr);
switch (index[n]) {
@@ -175,7 +175,8 @@ xact_t * csv_reader::read_xact(bool rich_data)
break;
case FIELD_DATE_AUX:
- xact->_date_aux = parse_date(field);
+ if (! field.empty())
+ xact->_date_aux = parse_date(field);
break;
case FIELD_CODE:
@@ -224,7 +225,8 @@ xact_t * csv_reader::read_xact(bool rich_data)
break;
case FIELD_NOTE:
- xact->note = field;
+ if (! field.empty())
+ xact->note = field;
break;
case FIELD_UNKNOWN: