diff --git a/cmd/syncthing/gui.go b/cmd/syncthing/gui.go index 80375d60c..8c8d00d8f 100644 --- a/cmd/syncthing/gui.go +++ b/cmd/syncthing/gui.go @@ -1134,9 +1134,9 @@ func (s *apiService) getPeerCompletion(w http.ResponseWriter, r *http.Request) { func (s *apiService) getSystemBrowse(w http.ResponseWriter, r *http.Request) { qs := r.URL.Query() current := qs.Get("current") - if current == "" && runtime.GOOS == "windows" { - if drives, err := osutil.GetDriveLetters(); err == nil { - sendJSON(w, drives) + if current == "" { + if roots, err := osutil.GetFilesystemRoots(); err == nil { + sendJSON(w, roots) } else { http.Error(w, err.Error(), 500) } diff --git a/lib/osutil/drives_unix.go b/lib/osutil/fsroots_unix.go similarity index 79% rename from lib/osutil/drives_unix.go rename to lib/osutil/fsroots_unix.go index 03f203470..7f02b5a18 100644 --- a/lib/osutil/drives_unix.go +++ b/lib/osutil/fsroots_unix.go @@ -8,6 +8,6 @@ package osutil -func GetDriveLetters() ([]string, error) { - return nil, nil +func GetFilesystemRoots() ([]string, error) { + return []string{"/"}, nil } diff --git a/lib/osutil/drives_windows.go b/lib/osutil/fsroots_windows.go similarity index 95% rename from lib/osutil/drives_windows.go rename to lib/osutil/fsroots_windows.go index 868b30a19..838770f40 100644 --- a/lib/osutil/drives_windows.go +++ b/lib/osutil/fsroots_windows.go @@ -15,7 +15,7 @@ import ( "unsafe" ) -func GetDriveLetters() ([]string, error) { +func GetFilesystemRoots() ([]string, error) { kernel32, err := syscall.LoadDLL("kernel32.dll") if err != nil { return nil, err