mirror of
https://github.com/containers/podman.git
synced 2025-06-27 05:26:50 +08:00
Trim whitespace from unit files while parsing
Fixes: https://github.com/containers/podman/issues/18979 Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -373,7 +373,7 @@ func (p *UnitFileParser) flushPendingComments(toComment bool) {
|
||||
func nextLine(data string, afterPos int) (string, string) {
|
||||
rest := data[afterPos:]
|
||||
if i := strings.Index(rest, "\n"); i >= 0 {
|
||||
return data[:i+afterPos], data[i+afterPos+1:]
|
||||
return strings.TrimSpace(data[:i+afterPos]), data[i+afterPos+1:]
|
||||
}
|
||||
return data, ""
|
||||
}
|
||||
|
Reference in New Issue
Block a user