From ed11851ae3053e146bafb45ecfc48b2520ba8bb1 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Fri, 18 Jan 2013 12:48:15 -0800 Subject: Improve handling for old XML files in Uemis downloader In order to work in the most expected ways for people who have used a version of Subsurface that didn't store the deviceid in the divecomputer we relax the testing for when a divecomputer entry is assumed to match the current divecomputer. Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/uemis-downloader.c b/uemis-downloader.c index 22d3bdc7d..4a9f4272b 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -735,7 +735,8 @@ static char *get_divenr(char *deviceidstr) struct divecomputer *dc = &dive_table.dives[i]->dc; while (dc) { if (dc->model && !strcmp(dc->model, "Uemis Zurich") && - dc->deviceid == deviceid && dc->diveid > maxdiveid) + (dc->deviceid == 0 || dc->deviceid == 0x7fffffff || dc->deviceid == deviceid) && + dc->diveid > maxdiveid) maxdiveid = dc->diveid; dc = dc->next; } -- cgit v1.2.3-70-g09d2