libgo: Update from Go 1.5 to Go 1.5.1.

Reviewed-on: https://go-review.googlesource.com/16527

From-SVN: r229624
This commit is contained in:
Ian Lance Taylor 2015-10-31 15:23:52 +00:00
parent 67376cd2a5
commit b9702967ee
16 changed files with 90 additions and 17 deletions

View file

@ -83,6 +83,8 @@ func Scanln(a ...interface{}) (n int, err error) {
// the format. It returns the number of items successfully scanned.
// If that is less than the number of arguments, err will report why.
// Newlines in the input must match newlines in the format.
// The one exception: the verb %c always scans the next rune in the
// input, even if it is a space (or tab etc.) or newline.
func Scanf(format string, a ...interface{}) (n int, err error) {
return Fscanf(os.Stdin, format, a...)
}
@ -1164,15 +1166,18 @@ func (s *ss) doScanf(format string, a []interface{}) (numProcessed int, err erro
if !widPresent {
s.maxWid = hugeWid
}
s.SkipSpace()
c, w := utf8.DecodeRuneInString(format[i:])
i += w
if c != 'c' {
s.SkipSpace()
}
s.argLimit = s.limit
if f := s.count + s.maxWid; f < s.argLimit {
s.argLimit = f
}
c, w := utf8.DecodeRuneInString(format[i:])
i += w
if numProcessed >= len(a) { // out of operands
s.errorString("too few operands for format %" + format[i-w:])
break