Skip to content

Commit c50c34e

Browse files
committed
changed line separator deteciton when parsing string
1 parent b70202e commit c50c34e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

txtar/archive.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func ParseFile(file string) (*Archive, error) {
8282
// The returned Archive holds slices of data.
8383
func Parse(data []byte) *Archive {
8484
a := new(Archive)
85-
i := bytes.IndexByte(data, '\n')
85+
i := bytes.Index(data, newlineMarker)
8686
if i > 0 && data[i-1] == '\r' {
8787
a.UseCRLF = true
8888
}

0 commit comments

Comments
 (0)