Skip to content

Commit

Permalink
Fix successive \r's being ignored
Browse files Browse the repository at this point in the history
  • Loading branch information
Naatan committed Sep 11, 2023
1 parent 33827d0 commit 1efe417
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,11 @@ func reverse[S ~[]E, E any](s S) {
}

func NormalizeLineEnds(v string) string {
return strings.ReplaceAll(v, lineSepWindows, lineSepPosix)
return strings.ReplaceAll(v, "\r", "")
}

func NormalizeLineEndsB(v []byte) []byte {
return bytes.ReplaceAll(v, []byte(lineSepWindows), []byte(lineSepPosix))
return bytes.ReplaceAll(v, []byte("\r"), []byte(""))
}

func copyBytes(b []byte) []byte {
Expand Down

0 comments on commit 1efe417

Please sign in to comment.