diff options
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/parse-xml.c b/parse-xml.c index 5159a334f..1c4db7d9d 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -39,11 +39,6 @@ void record_dive(struct dive *dive) dive_table.nr = nr+1; } -void record_trip(struct dive *trip) -{ - dive_trip_list = insert_trip(trip, dive_trip_list); -} - static void delete_dive_renumber(struct dive **dives, int i, int nr) { struct dive *dive = dives[i]; @@ -294,7 +289,7 @@ static enum number_type integer_or_float(char *buffer, union int_or_float *res) /* Looks like it might be floating point? */ if (*end == '.') { errno = 0; - fp = strtod(buffer, &end); + fp = g_ascii_strtod(buffer, &end); if (!errno) { res->fp = fp; return FLOAT; @@ -1165,10 +1160,10 @@ static void try_to_fill_trip(struct dive **divep, const char *name, char *buf) struct dive *dive = *divep; - if (MATCH(".date", divedate, &dive->when)) { - dive->when = utc_mktime(&cur_tm); + if (MATCH(".date", divedate, &dive->when)) + return; + if (MATCH(".time", divetime, &dive->when)) return; - } if (MATCH(".location", utf8_string, &dive->location)) return; if (MATCH(".notes", utf8_string, &dive->notes)) @@ -1213,7 +1208,7 @@ static void trip_end(void) { if (!cur_trip) return; - record_trip(cur_trip); + insert_trip(&cur_trip); cur_trip = NULL; } |