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>
This commit is contained in:
Linus Torvalds 2011-09-11 11:36:33 -07:00
parent d1b30212ff
commit 6538e5bba0
3 changed files with 13 additions and 4 deletions

View file

@ -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))