]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Properly save/restore cylinder description string
authorLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Sep 2011 22:07:47 +0000 (15:07 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 4 Sep 2011 22:14:14 +0000 (15:14 -0700)
We saved it under the wrong name, and didn't restore it at all. Fix.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
parse-xml.c
save-xml.c

index 75959d6828a61f70baedc1db959c2280e1ba7792..b123bb39f6998862bf794644cd9f31fbb791de83 100644 (file)
@@ -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;
index 46bcec0a18b3bbbe13b08c6f2ecc96f93ab95db7..64d65471132d3340756e1ff274c9ed807fe848c1 100644 (file)
@@ -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");
        }
 }