aboutsummaryrefslogtreecommitdiff
path: root/bpkg/manifest-parser.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-06-11 16:51:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-06-11 16:51:26 +0200
commit2ffe5ac2998b90c004de4f13e199c7ee965c3f75 (patch)
tree29f5fbb48ba0fe81209a1e0a2d8df98a3f651a58 /bpkg/manifest-parser.cxx
parented158b59063cd238a12bb022b465ebf491b43ef6 (diff)
Fix bug in value whitespace trimming
Diffstat (limited to 'bpkg/manifest-parser.cxx')
-rw-r--r--bpkg/manifest-parser.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/bpkg/manifest-parser.cxx b/bpkg/manifest-parser.cxx
index 68fd073..037b874 100644
--- a/bpkg/manifest-parser.cxx
+++ b/bpkg/manifest-parser.cxx
@@ -154,7 +154,7 @@ namespace bpkg
r.value_column = c.column ();
string& v (r.value);
- string::size_type n (0); // Size of last non-space character (simpel mode).
+ string::size_type n (0); // Size of last non-space character (simple mode).
// Detect the multi-line mode introductor.
//
@@ -219,7 +219,7 @@ namespace bpkg
get ();
v += '\n'; // Literal newline.
- n++;
+ n = v.size ();
continue; // Restart from the next character.
}
}
@@ -281,13 +281,13 @@ namespace bpkg
if (c2 == '\n' || is_eos (c1))
{
v += '\\';
- n++;
+ n = v.size ();
// Restart from c2 (newline/eos).
}
else
{
v += '\\';
- n++;
+ n = v.size ();
unget (c1); // Restart from c1 (second slash).
}
@@ -300,11 +300,8 @@ namespace bpkg
get ();
v += c;
- if (!ml)
- {
- if (c != ' ' && c != '\t')
- n++;
- }
+ if (!ml && c != ' ' && c != '\t')
+ n = v.size ();
}
// Cut off trailing whitespaces.