summaryrefslogtreecommitdiff
path: root/textual.cc
diff options
context:
space:
mode:
Diffstat (limited to 'textual.cc')
-rw-r--r--textual.cc17
1 files changed, 2 insertions, 15 deletions
diff --git a/textual.cc b/textual.cc
index ab74dd81..de4d32e4 100644
--- a/textual.cc
+++ b/textual.cc
@@ -554,6 +554,8 @@ unsigned int textual_parser_t::parse(std::istream& in,
char * b = skip_ws(line + 1);
char * p = std::strchr(b, ' ');
if (! p) break;
+ p = std::strchr(skip_ws(p), ' ');
+ if (! p) break;
*p++ = '\0';
struct std::tm when;
@@ -563,21 +565,6 @@ unsigned int textual_parser_t::parse(std::istream& in,
throw parse_error(path, linenum, "Failed to parse date");
}
- int hour, min, sec;
-
- if (! *p) break; hour = (*p++ - '0') * 10;
- if (! *p) break; hour += *p++ - '0';
- p++; if (! *p) break;
- if (! *p) break; min = (*p++ - '0') * 10;
- if (! *p) break; min += *p++ - '0';
- p++; if (! *p) break;
- if (! *p) break; sec = (*p++ - '0') * 10;
- if (! *p) break; sec += *p++ - '0';
- p++; if (! *p) break;
-
- date = std::time_t(((unsigned long) date) +
- hour * 3600 + min * 60 + sec);
-
std::string symbol;
amount_t price;