Fix handling of folded fields in Stanza. #270

Discovered by @sobczyk

When whitespace is stripped from folded stanza fields, some fields
values are glued together without whitespace which might change its meaning.
This commit is contained in:
Andrey Smirnov
2015-09-24 11:59:49 +03:00
parent 08bc5ac934
commit 76bf7cba04
2 changed files with 2 additions and 2 deletions

View File

@@ -230,7 +230,7 @@ func (c *ControlFileReader) ReadStanza(isRelease bool) (Stanza, error) {
if lastFieldMultiline {
stanza[lastField] += line + "\n"
} else {
stanza[lastField] += strings.TrimSpace(line)
stanza[lastField] += " " + strings.TrimSpace(line)
}
} else {
parts := strings.SplitN(line, ":", 2)