summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-05 14:09:49 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2011-10-05 14:09:49 -0700
commit6231b64d3de47dde9420d35ea7e6d620a3a2b966 (patch)
tree18f8f51d2ed2e0865afc9bc5431eea2fc0eb6f82 /main.c
parentdbdd42b31f73ad8e8117d5b2a5b4ac4e061bf202 (diff)
downloadsubsurface-6231b64d3de47dde9420d35ea7e6d620a3a2b966.tar.gz
Fix import tracking
Minor logical flaw that breaks the model. When the --import parameter is found we need to mark that the FOLLOWING dives are imported, not the ones loaded so far. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.c b/main.c
index 26d2eee22..ee09b9a82 100644
--- a/main.c
+++ b/main.c
@@ -98,6 +98,11 @@ static void try_to_renumber(struct dive *last, int preexisting)
}
/*
+ * track whether we switched to importing dives
+ */
+static gboolean imported = FALSE;
+
+/*
* This doesn't really report anything at all. We just sort the
* dives, the GUI does the reporting
*/
@@ -162,7 +167,8 @@ static void parse_argument(const char *arg)
if (strcmp(arg,"--import") == 0) {
/* mark the dives so far as the base,
* everything after is imported */
- report_dives(TRUE);
+ report_dives(FALSE);
+ imported = TRUE;
return;
}
/* fallthrough */
@@ -229,7 +235,7 @@ int main(int argc, char **argv)
}
}
- report_dives(FALSE);
+ report_dives(imported);
run_ui();
return 0;