From 85921592b052e2be867f049306abd28e69c978ae Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 4 Sep 2011 15:07:47 -0700 Subject: [PATCH] Properly save/restore cylinder description string We saved it under the wrong name, and didn't restore it at all. Fix. Signed-off-by: Linus Torvalds --- parse-xml.c | 2 ++ save-xml.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/parse-xml.c b/parse-xml.c index 75959d6..b123bb3 100644 --- a/parse-xml.c +++ b/parse-xml.c @@ -658,6 +658,8 @@ static void try_to_fill_dive(struct dive *dive, const char *name, char *buf) return; if (MATCH(".cylinder.workpressure", pressure, &dive->cylinder[cylinder_index].type.workingpressure)) return; + if (MATCH(".cylinder.description", utf8_string, &dive->cylinder[cylinder_index].type.description)) + return; if (MATCH(".o2", gasmix, &dive->cylinder[cylinder_index].gasmix.o2)) return; diff --git a/save-xml.c b/save-xml.c index 46bcec0..64d6547 100644 --- a/save-xml.c +++ b/save-xml.c @@ -143,7 +143,7 @@ static void save_cylinder_info(FILE *f, struct dive *dive) if (volume) fprintf(f, " size='%u.%03u l'", FRACTION(volume, 1000)); if (description) - fprintf(f, " name='%s'", description); + fprintf(f, " description='%s'", description); fprintf(f, " />\n"); } } -- 2.45.2