Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ef3edaf

Browse files
committed
fix bug count_file
1 parent ef57784 commit ef3edaf

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

‎support.c‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ file_node *make_list(char *path) // 디렉토리 파일 목록 트리화
5656
now = now->next;
5757
}
5858
}
59-
head->size = count_size(head->child);
59+
head->size = count_size(head);
6060
return head;
6161
}
6262

@@ -66,7 +66,11 @@ int count_size(file_node *head) // 디렉토리 크기 반환
6666
int size;
6767

6868
size = false;
69-
now = head;
69+
70+
if(S_ISDIR(head->attr.st_mode))
71+
now = head->child;
72+
else
73+
return head->attr.st_size;
7074

7175
while(now != NULL) {
7276
size += now->size;

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /