From c5a3d0b01c2c1f5c656bc484025ae38e14101a31 Mon Sep 17 00:00:00 2001 From: Ward Vandewege Date: Fri, 23 Apr 2021 16:42:27 -0400 Subject: [PATCH] In absPath, skip empty paths. --- cmd/headscale/headscale.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/headscale/headscale.go b/cmd/headscale/headscale.go index 970aa77b..4c967fd7 100644 --- a/cmd/headscale/headscale.go +++ b/cmd/headscale/headscale.go @@ -285,7 +285,7 @@ func main() { func absPath(path string) string { // If a relative path is provided, prefix it with the the directory where // the config file was found. - if !strings.HasPrefix(path, "/") { + if (path != "") && !strings.HasPrefix(path, "/") { dir, _ := filepath.Split(viper.ConfigFileUsed()) if dir != "" { path = dir + "/" + path