]> Cypherpunks repositories - gostls13.git/commit
fmt: treat \r\n as \n in Scan
authorRob Pike <r@golang.org>
Wed, 31 Jul 2013 05:00:08 +0000 (15:00 +1000)
committerRob Pike <r@golang.org>
Wed, 31 Jul 2013 05:00:08 +0000 (15:00 +1000)
commit221af5c12fe9769b723b8af2f000ed5f39a5dbb3
tree2df3125b74bd7de30cb50a76694b6be4011fae1f
parenta696ae56db451f2f02ffdf63092e0c06dba1d0c5
fmt: treat \r\n as \n in Scan
When scanning input and "white space" is permitted, a carriage return
followed immediately by a newline (\r\n) is treated exactly the same
as a plain newline (\n). I hope this makes it work better on Windows.

We do it everywhere, not just on Windows, since why not?

Fixes #5391.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/12142043
src/pkg/fmt/doc.go
src/pkg/fmt/scan.go
src/pkg/fmt/scan_test.go