diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-08-17 19:52:04 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-08-17 19:52:04 -0700 |
commit | 50f6c6d8bccee167dcaa005964af0468535524a3 (patch) | |
tree | db77633a73f6dc1fabee320ac9e69fe1c404d575 | |
parent | d2d4364afcc3fb310ea43573f0d455f90c9212ce (diff) | |
download | subsurface-50f6c6d8bccee167dcaa005964af0468535524a3.tar.gz |
When editing multiple files, don't override existing equipment entries
This parallels the logic used for all the string entries.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | info.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -473,12 +473,12 @@ void update_equipment_data(struct dive *dive, struct dive *master) { if (dive == master) return; - if (memcmp(remember_cyl, master->cylinder, sizeof(cylinder_t) * MAX_CYLINDERS)) { + if (memcmp(remember_cyl, master->cylinder, sizeof(cylinder_t) * MAX_CYLINDERS) && + cylinder_none(dive->cylinder)) memcpy(dive->cylinder, master->cylinder, sizeof(cylinder_t) * MAX_CYLINDERS); - } - if (memcmp(remember_ws, master->weightsystem, sizeof(weightsystem_t) * MAX_WEIGHTSYSTEMS)) { + if (memcmp(remember_ws, master->weightsystem, sizeof(weightsystem_t) * MAX_WEIGHTSYSTEMS) && + weightsystem_none(dive->weightsystem)) memcpy(dive->weightsystem, master->weightsystem, sizeof(weightsystem_t) * MAX_WEIGHTSYSTEMS); - } } int edit_multi_dive_info(int nr, int *indices) |