Skip to content

Commit 496d3b7

Browse files
committed
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 /.
1 parent 2b6b498 commit 496d3b7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

glog_file.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import (
2525
"os"
2626
"os/user"
2727
"path"
28+
"path/filepath"
2829
"strings"
2930
"sync"
3031
"time"
@@ -55,7 +56,7 @@ func createLogDirs() {
5556
if len(dir) == 0 {
5657
continue
5758
}
58-
if dir[0] != '/' {
59+
if !filepath.IsAbs(dir) {
5960
dir = "/" + dir
6061
}
6162
logDirs = append(logDirs, dir)

0 commit comments

Comments
 (0)