diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-11 11:36:33 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-09-11 11:36:33 -0700 |
commit | 6538e5bba00b51a7253b6cff927c8774f1b39e2b (patch) | |
tree | b6e322faaf26895c6b2ef2b8d399f1dabb78eebb /parse-xml.c | |
parent | d1b30212ff7192ef1b3fa85924433a8ddd92c281 (diff) | |
download | subsurface-6538e5bba00b51a7253b6cff927c8774f1b39e2b.tar.gz |
Save and restore a "dive number"
Some people want to know how many dives they have under their belt, so
let's save and restore the dive number if it exists.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r-- | parse-xml.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c index 4fd4dcfe6..a71ff235b 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -609,7 +609,8 @@ static void divinglog_place(char *place, void *_location) static int divinglog_dive_match(struct dive *dive, const char *name, int len, char *buf) { - return MATCH(".divedate", divedate, &dive->when) || + return MATCH(".id", get_index, &dive->nr) || + MATCH(".divedate", divedate, &dive->when) || MATCH(".entrytime", divetime, &dive->when) || MATCH(".depth", depth, &dive->maxdepth) || MATCH(".tanksize", cylindersize, &dive->cylinder[0].type.size) || @@ -876,6 +877,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf) break; } + if (MATCH(".nr", get_index, &dive->nr)) + return; if (MATCH(".date", divedate, &dive->when)) return; if (MATCH(".time", divetime, &dive->when)) |