aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-07-26 22:32:59 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-07-27 14:28:03 +0300
commita31945f682fc69340692680f2736aa74c186ef69 (patch)
tree9458e7ec6dd1e073317747fd7b92a0e4621eb104
parentcb9dc1dd4f9aae0c26e86563b37815f14cdbf3b2 (diff)
Make manifest serializer to accept non-empty versions for subsequent manifests
-rw-r--r--libbutl/manifest-serializer.cxx7
-rw-r--r--libbutl/manifest-serializer.mxx3
2 files changed, 7 insertions, 3 deletions
diff --git a/libbutl/manifest-serializer.cxx b/libbutl/manifest-serializer.cxx
index 73255b0..3d73f47 100644
--- a/libbutl/manifest-serializer.cxx
+++ b/libbutl/manifest-serializer.cxx
@@ -76,10 +76,13 @@ namespace butl
{
if (n.empty ())
{
+ s_ = start;
+
+ // Start new manifest if the end-of-manifest pair is omitted.
+ //
if (!v.empty ())
- throw serialization (name_, "non-empty value in end pair");
+ return next (n, v);
- s_ = start;
break;
}
diff --git a/libbutl/manifest-serializer.mxx b/libbutl/manifest-serializer.mxx
index e063f17..a1864d6 100644
--- a/libbutl/manifest-serializer.mxx
+++ b/libbutl/manifest-serializer.mxx
@@ -55,7 +55,8 @@ LIBBUTL_MODEXPORT namespace butl
// with empty name and value. After that we can either have another
// start-of-manifest pair (in which case the whole sequence repeats
// from the beginning) or we get another end-of-manifest pair which
- // signals the end of stream.
+ // signals the end of stream. The end-of-manifest pair can be omitted
+ // if it is followed by the start-of-manifest pair.
//
void
next (const std::string& name, const std::string& value);