Skip to content

Commit c426214

Browse files
author
anahan
committed
DataListener.normalizeLine now append \n if not present
1 parent 247be51 commit c426214

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/applog/data_listener.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@ func NewDataListener(socketPath string, rPool *breader.Pool, writer io.Writer, e
2626

2727
func (l *DataListener) normalizeLine(line []byte) []byte {
2828
ll := len(line)
29+
if ll > 0 && line[ll-1] != '\n' {
30+
ll += 1
31+
line = append(line, '\n')
32+
}
33+
2934
if ll > 1 && line[ll-2] == '\r' {
3035
line[ll-2] = line[ll-1]
3136
line = line[:ll-1]

0 commit comments

Comments
 (0)