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 committed 2015-09-24 11:59:49 +03:00
1 parent 08bc5ac934
commit 76bf7cba04
2 files changed
+2 -2

No files matched your search

+1 -1
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)