read_directory_recursive: reduce one indentation level
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
5fb8c05f2e
commit
02cb67530e
10
dir.c
10
dir.c
@ -968,10 +968,12 @@ static int read_directory_recursive(struct dir_struct *dir,
|
|||||||
{
|
{
|
||||||
DIR *fdir = opendir(*base ? base : ".");
|
DIR *fdir = opendir(*base ? base : ".");
|
||||||
int contents = 0;
|
int contents = 0;
|
||||||
|
|
||||||
if (fdir) {
|
|
||||||
struct dirent *de;
|
struct dirent *de;
|
||||||
char path[PATH_MAX + 1];
|
char path[PATH_MAX + 1];
|
||||||
|
|
||||||
|
if (!fdir)
|
||||||
|
return 0;
|
||||||
|
|
||||||
memcpy(path, base, baselen);
|
memcpy(path, base, baselen);
|
||||||
|
|
||||||
while ((de = readdir(fdir)) != NULL) {
|
while ((de = readdir(fdir)) != NULL) {
|
||||||
@ -979,8 +981,7 @@ static int read_directory_recursive(struct dir_struct *dir,
|
|||||||
switch (treat_path(dir, de, path, sizeof(path),
|
switch (treat_path(dir, de, path, sizeof(path),
|
||||||
baselen, simplify, &len)) {
|
baselen, simplify, &len)) {
|
||||||
case path_recurse:
|
case path_recurse:
|
||||||
contents += read_directory_recursive
|
contents += read_directory_recursive(dir, path, len, 0, simplify);
|
||||||
(dir, path, len, 0, simplify);
|
|
||||||
continue;
|
continue;
|
||||||
case path_ignored:
|
case path_ignored:
|
||||||
continue;
|
continue;
|
||||||
@ -995,7 +996,6 @@ static int read_directory_recursive(struct dir_struct *dir,
|
|||||||
}
|
}
|
||||||
exit_early:
|
exit_early:
|
||||||
closedir(fdir);
|
closedir(fdir);
|
||||||
}
|
|
||||||
|
|
||||||
return contents;
|
return contents;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user