]> Cypherpunks repositories - gostls13.git/commitdiff
net: do not require newline at end of resolv.conf
authorRuss Cox <rsc@golang.org>
Thu, 29 Apr 2010 02:36:04 +0000 (19:36 -0700)
committerRuss Cox <rsc@golang.org>
Thu, 29 Apr 2010 02:36:04 +0000 (19:36 -0700)
Fixes #686.

R=adg
CC=golang-dev
https://golang.org/cl/961046

src/pkg/net/parse.go

index a7dcb35f0e8a4ed32f731b876f11e4971a53dfcc..ff980f412eabf62b3393c9d87d824280a47342d2 100644 (file)
@@ -35,6 +35,11 @@ func (f *file) getLineFromData() (s string, ok bool) {
                        return
                }
        }
+       if len(f.data) > 0 {
+               s = string(data)
+               f.data = nil
+               ok = true
+       }
        return
 }