diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2019-07-14 10:43:38 -0700 |
---|---|---|
committer | bstoeger <32835590+bstoeger@users.noreply.github.com> | 2019-07-14 22:17:13 +0200 |
commit | 36121fd8aec56dbcaea61c3f09680699dc717ba8 (patch) | |
tree | 41074d28084a321bfcbfbb50aa644e24d69c5497 | |
parent | c685c05ff413867114e6029ea182732d40fe1a64 (diff) | |
download | subsurface-36121fd8aec56dbcaea61c3f09680699dc717ba8.tar.gz |
Fix up XML saving of remaining bottom time data
While testing the cylinder type saving fix, I noticed that the RBT
saving was broken. Instead of saving RBT whenever it changed, we'd save
it when it was non-zero. Which doesn't match the git save format, and
also doesn't match what we do when loading an xml file (where we default
to the previous RBT value, and a sample RBT will modify it).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | core/save-xml.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/core/save-xml.c b/core/save-xml.c index da7b4738b..75e90f921 100644 --- a/core/save-xml.c +++ b/core/save-xml.c @@ -277,8 +277,10 @@ static void save_sample(struct membuffer *b, struct sample *sample, struct sampl put_format(b, " tts='%u:%02u min'", FRACTION(sample->tts.seconds, 60)); old->tts = sample->tts; } - if (sample->rbt.seconds) + if (sample->rbt.seconds != old->rbt.seconds) { put_format(b, " rbt='%u:%02u min'", FRACTION(sample->rbt.seconds, 60)); + old->rbt = sample->rbt; + } if (sample->in_deco != old->in_deco) { put_format(b, " in_deco='%d'", sample->in_deco ? 1 : 0); old->in_deco = sample->in_deco; |