git-daemon --base-path
[gitweb.git] / ls-files.c
index cc5b32e8bac12105873ecee73a9fc9036d71b61b..b29fe1be7e9f48bafafd2bd197c7238ee251b2cd 100644 (file)
@@ -293,11 +293,12 @@ static void read_directory(const char *path, const char *base, int baselen)
                                /* fallthrough */
                        case DT_DIR:
                                memcpy(fullname + baselen + len, "/", 2);
+                               len++;
                                if (show_other_directories &&
-                                   !dir_exists(fullname, baselen + len + 1))
+                                   !dir_exists(fullname, baselen + len))
                                        break;
                                read_directory(fullname, fullname,
-                                              baselen + len + 1);
+                                              baselen + len);
                                continue;
                        case DT_REG:
                        case DT_LNK: