From a00bfc918a0813c6bbc6bb44a577aa3ee929da5c Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Tue, 19 Feb 2013 11:04:30 -0800 Subject: Fix find_trip_by_idx() over-zealous cleanup Commit bcf1f8c4feb9 ("Don't do "remove_from_trip" by walking the gtk data structures") made find_trip_by_idx() only work for negative indexes (positive indexes are dives), but when it removed the unnecessary test for negativity, the statement inside it should have been kept as unconditional, rather than removed with the test. Oops. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- divelist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/divelist.c b/divelist.c index 8dac63f34..08f47121c 100644 --- a/divelist.c +++ b/divelist.c @@ -1035,7 +1035,7 @@ static dive_trip_t *find_trip_by_idx(int idx) if (idx >= 0) return NULL; - + idx = -idx; while (trip) { if (trip->index == idx) return trip; -- cgit v1.2.3-70-g09d2