From 36121fd8aec56dbcaea61c3f09680699dc717ba8 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 14 Jul 2019 10:43:38 -0700 Subject: [PATCH] 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 --- core/save-xml.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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;