From d166e34fed53786000b9afa353e806b918d53714 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sat, 17 Nov 2012 13:04:31 -0800 Subject: Fix silly thinko in recent changes to "Delete dive" code Commit 38c79d149db0 ("Simplify and clean up dive trip management") simplified the code a bit *too* much, and removed the check for "dive->selected". As a result, trying to delete a dive resulted in *all* dives being deleted. Oops. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- divelist.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'divelist.c') diff --git a/divelist.c b/divelist.c index 3e48d2fb9..59db7c208 100644 --- a/divelist.c +++ b/divelist.c @@ -2032,6 +2032,8 @@ static void delete_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path) dive = get_dive(i); if (!dive) continue; + if (!dive->selected) + continue; /* now remove the dive from the table and free it. also move the iterator back, * so that we don't skip a dive */ delete_single_dive(i); -- cgit v1.2.3-70-g09d2