diff options
author | Rob Pike <r@golang.org> | 2010-07-01 14:08:14 -0700 |
---|---|---|
committer | Rob Pike <r@golang.org> | 2010-07-01 14:08:14 -0700 |
commit | b3fb215bd4973f0a8b52d49bcb90f31ca64ae781 (patch) | |
tree | 5b188afe344ef0e4cb39832efc2d76613bc2e5e2 /src/cmd/cgo/gcc.go | |
parent | 32de5c228f33e6bcfef081d51da8263747a6c448 (diff) | |
download | golang-b3fb215bd4973f0a8b52d49bcb90f31ca64ae781.tar.gz |
strings and bytes.Split: make count of 0 mean 0, not infinite.
Use a count of -1 for infinity. Ditto for Replace.
R=rsc
CC=golang-dev
http://codereview.appspot.com/1704044
Committer: Rob Pike <r@golang.org>
Diffstat (limited to 'src/cmd/cgo/gcc.go')
-rw-r--r-- | src/cmd/cgo/gcc.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go index bd64f0cb4..5e12a6687 100644 --- a/src/cmd/cgo/gcc.go +++ b/src/cmd/cgo/gcc.go @@ -27,7 +27,7 @@ func (p *Prog) loadDebugInfo() { b.WriteString(p.Preamble) stdout := p.gccPostProc(b.Bytes()) defines := make(map[string]string) - for _, line := range strings.Split(stdout, "\n", 0) { + for _, line := range strings.Split(stdout, "\n", -1) { if len(line) < 9 || line[0:7] != "#define" { continue } @@ -110,7 +110,7 @@ func (p *Prog) loadDebugInfo() { if stderr == "" { fatal("gcc produced no output") } - for _, line := range strings.Split(stderr, "\n", 0) { + for _, line := range strings.Split(stderr, "\n", -1) { if len(line) < 9 || line[0:9] != "cgo-test:" { continue } @@ -631,7 +631,7 @@ func (c *typeConv) Type(dtype dwarf.Type) *Type { if ss, ok := cnameMap[s]; ok { s = ss } - s = strings.Join(strings.Split(s, " ", 0), "") // strip spaces + s = strings.Join(strings.Split(s, " ", -1), "") // strip spaces name := c.Ident("_C_" + s) c.typedef[name.Name()] = t.Go t.Go = name |