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>
This commit is contained in:
Linus Torvalds 2019-07-14 10:43:38 -07:00 committed by bstoeger
parent c685c05ff4
commit 36121fd8ae

View file

@ -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;