commit | 496d3b747b2851cc98f4838bcfa59f707c4cee25 | [log] [tgz] |
---|---|---|
author | Rob Pike <r@golang.org> | Wed Jul 17 10:26:02 2013 +1000 |
committer | Rob Pike <r@golang.org> | Wed Jul 17 10:26:02 2013 +1000 |
tree | 887ecc15f4d4cfea62f0e0f368b9a184abd6432b | |
parent | 2b6b49888830bc4add903e415386fc24afa3797c [diff] |
Use filepath.IsAbs to see if temp directory is local. Fixes a problem on Windows, since the old code assumed a rooted path starts with /.
diff --git a/glog_file.go b/glog_file.go index 053c203..1bcfaaa 100644 --- a/glog_file.go +++ b/glog_file.go
@@ -25,6 +25,7 @@ "os" "os/user" "path" + "path/filepath" "strings" "sync" "time" @@ -55,7 +56,7 @@ if len(dir) == 0 { continue } - if dir[0] != '/' { + if !filepath.IsAbs(dir) { dir = "/" + dir } logDirs = append(logDirs, dir)