diff --git a/src/protocol/file/file.c b/src/protocol/file/file.c index f5524fb9..52083748 100644 --- a/src/protocol/file/file.c +++ b/src/protocol/file/file.c @@ -271,7 +271,10 @@ file_protocol_handler(struct connection *connection) decode_uri_string(&name); - if (file_is_dir(name.source)) { + /* In Win32, file_is_dir seems to always return 0 if the name + * ends with a directory separator. */ + if ((name.length > 0 && dir_sep(name.source[name.length - 1])) + || file_is_dir(name.source)) { /* In order for global history and directory listing to * function properly the directory url must end with a * directory separator. */