+ if (success) {
+ /* Update the other non-current dives first */
+ for (i = 0; i < nr; i++) {
+ int idx = indices[i];
+ struct dive *dive = get_dive(idx);
+
+ if (!dive || dive == master)
+ continue;
+ /* copy all "info" fields */
+ save_dive_info_changes(dive, master, &info);
+ /* copy the cylinders / weightsystems */
+ update_equipment_data(dive, master);
+ /* this is extremely inefficient... it loops through all
+ dives to find the right one - but we KNOW the index already */
+ flush_divelist(dive);
+ }
+
+ /* Update the master dive last! */
+ save_dive_info_changes(master, master, &info);
+ update_equipment_data(master, master);
+ flush_divelist(master);
+ }