summaryrefslogtreecommitdiff
path: root/src/pkg/json/parse.go
diff options
context:
space:
mode:
authorAndrew Skiba <skibaa@gmail.com>2009-11-30 12:03:26 -0800
committerAndrew Skiba <skibaa@gmail.com>2009-11-30 12:03:26 -0800
commit00cdce0ef28d7d26fdf862575b74095e394883a8 (patch)
treee51b4651c15c1b30c0ee9f50005c46979897f19e /src/pkg/json/parse.go
parent8becfe92f8768638faa708a96c5faf7a25ac2f88 (diff)
downloadgolang-00cdce0ef28d7d26fdf862575b74095e394883a8.tar.gz
Handle \r as a whitespace when parsing JSON string.
Fixes issue 272. R=rsc http://codereview.appspot.com/161061 Committer: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src/pkg/json/parse.go')
-rw-r--r--src/pkg/json/parse.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/json/parse.go b/src/pkg/json/parse.go
index 008637593..f9c472977 100644
--- a/src/pkg/json/parse.go
+++ b/src/pkg/json/parse.go
@@ -198,7 +198,7 @@ func punct(c byte) bool {
return c == '"' || c == '[' || c == ']' || c == ':' || c == '{' || c == '}' || c == ','
}
-func white(c byte) bool { return c == ' ' || c == '\t' || c == '\n' || c == '\v' }
+func white(c byte) bool { return c == ' ' || c == '\t' || c == '\r' || c == '\n' || c == '\v' }
func skipwhite(p string, i int) int {
for i < len(p) && white(p[i]) {