Skip to content

Commit

Permalink
changed line separator deteciton when parsing string
Browse files Browse the repository at this point in the history
  • Loading branch information
bsponge committed Apr 9, 2023
1 parent b70202e commit c50c34e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion txtar/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ func ParseFile(file string) (*Archive, error) {
// The returned Archive holds slices of data.
func Parse(data []byte) *Archive {
a := new(Archive)
i := bytes.IndexByte(data, '\n')
i := bytes.Index(data, newlineMarker)
if i > 0 && data[i-1] == '\r' {
a.UseCRLF = true
}
Expand Down

0 comments on commit c50c34e

Please sign in to comment.