lib/osutil: Return "/" as filesystem root on non-windows (fixes #3321)
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3332
This commit is contained in:
committed by
Jakob Borg
parent
379e2119a8
commit
502bee9a09
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user