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/pkg/exp | |
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/pkg/exp')
-rw-r--r-- | src/pkg/exp/nacl/srpc/client.go | 2 | ||||
-rw-r--r-- | src/pkg/exp/ogle/cmd.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/pkg/exp/nacl/srpc/client.go b/src/pkg/exp/nacl/srpc/client.go index d271a82ff..f45730ffa 100644 --- a/src/pkg/exp/nacl/srpc/client.go +++ b/src/pkg/exp/nacl/srpc/client.go @@ -67,7 +67,7 @@ func NewClient(fd int) (c *Client, err os.Error) { log.Stderrf("NewClient service_discovery: %s", m.status) return nil, m.status } - for n, line := range bytes.Split(m.Ret[0].([]byte), []byte{'\n'}, 0) { + for n, line := range bytes.Split(m.Ret[0].([]byte), []byte{'\n'}, -1) { i := bytes.Index(line, []byte{':'}) if i < 0 { continue diff --git a/src/pkg/exp/ogle/cmd.go b/src/pkg/exp/ogle/cmd.go index 45b47ef5b..2f087b777 100644 --- a/src/pkg/exp/ogle/cmd.go +++ b/src/pkg/exp/ogle/cmd.go @@ -153,7 +153,7 @@ func cmdLoad(args []byte) os.Error { } println("Attached to", pid) } else { - parts := strings.Split(path, " ", 0) + parts := strings.Split(path, " ", -1) if len(parts) == 0 { fname = "" } else { |