]> Cypherpunks.ru repositories - goredo.git/commitdiff
Explicitly top at the filesystem root
authorSergey Matveev <stargrave@stargrave.org>
Mon, 14 Dec 2020 16:39:39 +0000 (19:39 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Mon, 14 Dec 2020 16:39:39 +0000 (19:39 +0300)
It just removes duplicate highest level relative do-path.

main.go

diff --git a/main.go b/main.go
index 818b8dafeb830d85300c397107020572bfe0c32f..6cda53efec6821a59a0b3d7562bd390ea3928d40 100644 (file)
--- a/main.go
+++ b/main.go
@@ -104,7 +104,9 @@ func main() {
        NoSync = os.Getenv(EnvNoSync) == "1"
 
        TopDir = os.Getenv(EnvTopDir)
-       if TopDir != "" {
+       if TopDir == "" {
+               TopDir = "/"
+       } else {
                TopDir, err = filepath.Abs(TopDir)
                if err != nil {
                        panic(err)