Fixed newline format detection for files not ending with a newline (#2875)
* Fixed newline format detection for files not ending with a newline Files with Windows-style line endings were being converted to Unix-style if the file did not end with a newline * Updated file format detection fix for consistency
This commit is contained in:
parent
c27593c163
commit
c55fb3329f
1 changed files with 2 additions and 2 deletions
|
@ -116,12 +116,12 @@ func NewLineArray(size uint64, endings FileFormat, reader io.Reader) *LineArray
|
|||
dlen := len(data)
|
||||
if dlen > 1 && data[dlen-2] == '\r' {
|
||||
data = append(data[:dlen-2], '\n')
|
||||
if endings == FFAuto {
|
||||
if la.Endings == FFAuto {
|
||||
la.Endings = FFDos
|
||||
}
|
||||
dlen = len(data)
|
||||
} else if dlen > 0 {
|
||||
if endings == FFAuto {
|
||||
if la.Endings == FFAuto {
|
||||
la.Endings = FFUnix
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue