macOS requires URLs to directories to end with a slash

This commit is contained in:
Kovid Goyal
2026-05-17 08:38:11 +05:30
parent 5669df4022
commit a1b1b89feb
2 changed files with 5 additions and 1 deletions

View File

@@ -395,6 +395,9 @@ func dnd_main(cmd *cli.Command, opts *Options, args []string) (rc int, err error
if runtime.GOOS == "windows" && !strings.HasPrefix(upath, "/") {
upath = "/" + upath
}
if st.IsDir() && !strings.HasSuffix(upath, "/") {
upath += "/"
}
u := &url.URL{Scheme: "file", Path: upath}
uri_list = append(uri_list, uri_list_item{path: path, uri: u.String(), human_name: arg, metadata: st})
} else {