From a6c05a9e83872069f104e42508a6bf41cbbefc1c Mon Sep 17 00:00:00 2001 From: Sergey Lyubka <valenok@gmail.com> Date: Mon, 24 Mar 2014 20:39:32 +0000 Subject: [PATCH] changed handle_propfind() to report only dir entry when listing dir --- mongoose.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mongoose.c b/mongoose.c index e704b1e77..94cc65b0e 100644 --- a/mongoose.c +++ b/mongoose.c @@ -3187,12 +3187,9 @@ static void handle_propfind(struct connection *conn, const char *path, int i, num_entries = scan_directory(conn, path, &arr); for (i = 0; i < num_entries; i++) { - char buf[MAX_PATH_SIZE], buf2[sizeof(buf) * 3]; + char buf[MAX_PATH_SIZE * 3]; struct dir_entry *de = &arr[i]; - - mg_snprintf(buf, sizeof(buf), "%s%s", de->conn->mg_conn.uri, - de->file_name); - mg_url_encode(buf, buf2, sizeof(buf2) - 1); + mg_url_encode(de->file_name, buf, sizeof(buf) - 1); print_props(conn, buf, &de->st); } } -- GitLab