summaryrefslogtreecommitdiff
path: root/src/cmd/cgo/gcc.go
diff options
context:
space:
mode:
authorRob Pike <r@golang.org>2010-07-01 14:08:14 -0700
committerRob Pike <r@golang.org>2010-07-01 14:08:14 -0700
commitb3fb215bd4973f0a8b52d49bcb90f31ca64ae781 (patch)
tree5b188afe344ef0e4cb39832efc2d76613bc2e5e2 /src/cmd/cgo/gcc.go
parent32de5c228f33e6bcfef081d51da8263747a6c448 (diff)
downloadgolang-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.go6
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