[tools] txtar: handle crlf line endings

1 view
Skip to first unread message

Gopher Robot (Gerrit)

unread,
Sep 30, 2025, 5:47:24 PM (yesterday) Sep 30
to Paško Zdilar, Gerrit Bot, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, Carlos Amedee, Michael Matloob, Michael Matloob, Go LUCI, golang-co...@googlegroups.com

Gopher Robot submitted the change

Change information

Commit message:
txtar: handle crlf line endings

Function isMarker detects a file marker line by checking if the data before
the first '\n' has a marker prefix and suffix.
In the case of CRLF line endings, the data before the first '\n' ends with
'\r', so the suffix check fails.

Here, '\r' is trimmed before checking the suffix.

Fixes golang/go#59264.
Change-Id: I030357915abaa61f492b9d3d81a7edbd5d09d78e
GitHub-Last-Rev: 69a9348f2fd1bca236d382ff5482d008dfa784b8
GitHub-Pull-Request: golang/tools#595
Reviewed-by: Sean Liao <se...@liao.dev>
Reviewed-by: Michael Matloob <mat...@golang.org>
Auto-Submit: Sean Liao <se...@liao.dev>
Reviewed-by: Michael Matloob <mat...@google.com>
Reviewed-by: Carlos Amedee <car...@golang.org>
Files:
  • M txtar/archive.go
  • M txtar/archive_test.go
Change size: S
Delta: 2 files changed, 11 insertions(+), 0 deletions(-)
Branch: refs/heads/master
Submit Requirements:
  • requirement satisfiedCode-Review: +1 by Carlos Amedee, +2 by Michael Matloob, +2 by Sean Liao, +1 by Michael Matloob
  • requirement satisfiedTryBots-Pass: LUCI-TryBot-Result+1 by Go LUCI
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: tools
Gerrit-Branch: master
Gerrit-Change-Id: I030357915abaa61f492b9d3d81a7edbd5d09d78e
Gerrit-Change-Number: 706676
Gerrit-PatchSet: 6
Gerrit-Owner: Gerrit Bot <letsus...@gmail.com>
Gerrit-Reviewer: Carlos Amedee <car...@golang.org>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@golang.org>
Gerrit-Reviewer: Michael Matloob <mat...@google.com>
Gerrit-Reviewer: Sean Liao <se...@liao.dev>
Gerrit-CC: Paško Zdilar <pasko...@gmail.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages