aboutsummaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 23:35:52 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-12 23:35:52 -0800
commitd4f2b7214863b2a40ebcf69e7add113412f795b8 (patch)
treea0f1210a109371e69f83a283f8583c3ba6304c6a /parse-xml.c
parentae49a8a4f7c277644a62b096585ee467f3cad5c7 (diff)
downloadsubsurface-d4f2b7214863b2a40ebcf69e7add113412f795b8.tar.gz
Make special backup when switching XML versions
Since the last few dozen commits change the format in irreversible ways and could therefore be destructive and lose data for testers of the development version, let's try to be extra careful and create "special" backup files that aren't overwritten by subsequent backups. At least this way people can go back to the previous state. Of course people using the git backend don't have to worry about this as they always can go back to any earlier save. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index c93d25453..6cc2d881a 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -21,6 +21,7 @@
int verbose, quit;
int metric = 1;
+int last_xml_version = -1;
static xmlDoc *test_xslt_transforms(xmlDoc *doc, const char **params);
@@ -1644,6 +1645,9 @@ static void userid_stop(void)
static void entry(const char *name, char *buf)
{
+ if (!strncmp(name, "version.program", sizeof("version.program") - 1) ||
+ !strncmp(name, "version.divelog", sizeof("version.divelog") - 1))
+ last_xml_version = atoi(buf);
if (in_userid) {
try_to_fill_userid(name, buf);
return;