strconv: return ErrSyntax when unquoting illegal octal sequences. This
is consistent with what the Go compiler returns when such sequences
appear in string literals.
Fixes #2658.
R=golang-dev, rsc, r, r, nigeltao
CC=golang-dev
https://golang.org/cl/5530051
diff --git a/src/pkg/strconv/quote.go b/src/pkg/strconv/quote.go
index edba629..61dbcae 100644
--- a/src/pkg/strconv/quote.go
+++ b/src/pkg/strconv/quote.go
@@ -260,6 +260,7 @@
for j := 0; j < 2; j++ { // one digit already; two more
x := rune(s[j]) - '0'
if x < 0 || x > 7 {
+ err = ErrSyntax
return
}
v = (v << 3) | x