summaryrefslogtreecommitdiff
path: root/datetime.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2005-04-15 22:06:37 +0000
committerJohn Wiegley <johnw@newartisans.com>2008-04-13 02:41:08 -0400
commit6adc5e751838c182a42fda68a7bcaeb85bd3115b (patch)
tree8c4ce5d41d21a23d3a309ad43b5c71ab4f92d31e /datetime.cc
parent18881e9a51c7f65bf85d08746e6d4cde900316db (diff)
downloadfork-ledger-6adc5e751838c182a42fda68a7bcaeb85bd3115b.tar.gz
fork-ledger-6adc5e751838c182a42fda68a7bcaeb85bd3115b.tar.bz2
fork-ledger-6adc5e751838c182a42fda68a7bcaeb85bd3115b.zip
(quick_parse_date): [1178218] Fixed date problem by avoiding an
optimization that was being used before for the sake of the textual parser.
Diffstat (limited to 'datetime.cc')
-rw-r--r--datetime.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/datetime.cc b/datetime.cc
index 685939aa..591ba8ee 100644
--- a/datetime.cc
+++ b/datetime.cc
@@ -307,6 +307,9 @@ bool parse_date(const char * date_str, std::time_t * result, const int year)
bool quick_parse_date(const char * date_str, std::time_t * result)
{
+#if 1
+ return parse_date(date_str, result, now_year);
+#else
int year = -1, month = -1, day, num = 0;
for (const char * p = date_str; *p; p++) {
@@ -358,6 +361,7 @@ bool quick_parse_date(const char * date_str, std::time_t * result)
*result += day * 24 * 60 * 60;
return true;
+#endif
}
} // namespace ledger