summaryrefslogtreecommitdiffstats
path: root/info.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-17 07:39:50 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-17 07:39:50 -0700
commit70f903c457a3b82cdaa62e232124cdbba5c11bc5 (patch)
tree7a87b5aab86320ebf24c31179a44d377d504dfbc /info.c
parent94516177605484dacf724602c43f34b984d06ba8 (diff)
downloadsubsurface-70f903c457a3b82cdaa62e232124cdbba5c11bc5.tar.gz
multi-dive editing: don't change fields that weren't changed for the master dive
Commit 2f773b97e042 ("multi-dive editing: don't change already set data for other dives") didn't get the multi-dive editing quite right: even if one of the dives in the list of changed dives has an empty field, we should *not* fill it with the edit data unless that edit data was actually changed. So compare the new data with the original master data, and if they match, do nothing. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'info.c')
-rw-r--r--info.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/info.c b/info.c
index 846d51efc..5a620e751 100644
--- a/info.c
+++ b/info.c
@@ -83,6 +83,9 @@ static char *get_combo_box_entry_text(GtkComboBoxEntry *combo_box, char **textp,
new = gtk_entry_get_text(entry);
while (isspace(*new))
new++;
+ /* If the master string didn't change, don't change other dives either! */
+ if (!text_changed(master,new))
+ return NULL;
if (!text_changed(old,new))
return NULL;
free(old);