From ce3a78efcac2c9b6bd215bc191560a64c54fd628 Mon Sep 17 00:00:00 2001 From: Salvador Cuñat Date: Thu, 7 Jan 2016 23:21:28 +0100 Subject: Assign lower number to a merged dive instead of higher one MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit At the moment, if we have, say, dives ... 100, 101 and 102 and we merge 101 and 102, we get a list numbered ... 99, 100, 102. This is, probably, an undesired behavior. The patch simple chooses lower of both dive numbers instead of higher one. Signed-off-by: Salvador Cuñat Acked-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- subsurface-core/dive.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsurface-core/dive.c b/subsurface-core/dive.c index f0baf076a..9af63791a 100644 --- a/subsurface-core/dive.c +++ b/subsurface-core/dive.c @@ -2856,7 +2856,7 @@ struct dive *merge_dives(struct dive *a, struct dive *b, int offset, bool prefer MERGE_TXT(res, a, b, divemaster); MERGE_MAX(res, a, b, rating); MERGE_TXT(res, a, b, suit); - MERGE_MAX(res, a, b, number); + MERGE_MIN(res, a, b, number); MERGE_NONZERO(res, a, b, cns); MERGE_NONZERO(res, a, b, visibility); MERGE_NONZERO(res, a, b, picture_list); -- cgit v1.2.3-70-g09d2