From fa33920da2c1f8c529d034e73d012e2c5a5937e9 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Wed, 18 Jul 2007 00:25:07 +0300 Subject: [PATCH] Win32: Don't check file_is_dir if name ends with backslash. --- src/protocol/file/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/protocol/file/file.c b/src/protocol/file/file.c index cfa846609..e4f854c0f 100644 --- a/src/protocol/file/file.c +++ b/src/protocol/file/file.c @@ -304,7 +304,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. */