- /* 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 non-current selected dives first */
+ if (index < 0) {
+ int i;
+ struct dive *dive;
+
+ for (i = 0; (dive = get_dive(i)) != NULL; i++) {
+ if (dive == master || !dive->selected)
+ 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);
+ }