Index: C:/workspace/lighttdpfix/mod_webdav.c =================================================================== --- C:/workspace/lighttdpfix/mod_webdav.c (revision 2357) +++ C:/workspace/lighttdpfix/mod_webdav.c (working copy) @@ -1441,8 +1441,7 @@ prop_200 = buffer_init(); prop_404 = buffer_init(); - switch(depth) { - case 0: + /* Depth: 0 */ webdav_get_props(srv, con, p, &(con->physical), req_props, prop_200, prop_404); @@ -1481,8 +1480,8 @@ buffer_append_string_len(b,CONST_STR_LEN("\n")); - break; - case 1: + if(depth == 1){ + if (NULL != (dir = opendir(con->physical.path->ptr))) { struct dirent *de; physical d; @@ -1492,9 +1491,9 @@ d.rel_path = buffer_init(); while(NULL != (de = readdir(dir))) { - if (de->d_name[0] == '.' && de->d_name[1] == '.' && de->d_name[2] == '\0') { + if (de->d_name[0] == '.' && (de->d_name[1] == '\0' || (de->d_name[1] == '.' && de->d_name[2] == '\0'))) { continue; - /* ignore the parent dir */ + /* ignore the parent and target dir */ } buffer_copy_string_buffer(d.path, dst->path); @@ -1503,12 +1502,12 @@ buffer_copy_string_buffer(d.rel_path, dst->rel_path); PATHNAME_APPEND_SLASH(d.rel_path); - if (de->d_name[0] == '.' && de->d_name[1] == '\0') { - /* don't append the . */ - } else { + + + buffer_append_string(d.path, de->d_name); buffer_append_string(d.rel_path, de->d_name); - } + buffer_reset(prop_200); buffer_reset(prop_404); @@ -1554,7 +1553,7 @@ buffer_free(d.path); buffer_free(d.rel_path); } - break; + } if (req_props) {