mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 01:08:41 -09:00
calc.c: Fix path display when scanning an empty directory
http://dev.yorhel.nl/ncdu/bug/15
This commit is contained in:
parent
832b91b033
commit
399ccdeb47
1 changed files with 5 additions and 5 deletions
10
src/calc.c
10
src/calc.c
|
|
@ -458,11 +458,6 @@ int calc_process() {
|
|||
/* calculate */
|
||||
n = calc_dir(root, name);
|
||||
|
||||
/* free some resources */
|
||||
if(!path[1] && strcmp(name, "."))
|
||||
free(name);
|
||||
free(path);
|
||||
|
||||
if(links) {
|
||||
kh_destroy(hl, links);
|
||||
links = NULL;
|
||||
|
|
@ -473,6 +468,7 @@ int calc_process() {
|
|||
if(root->sub == NULL) {
|
||||
freedir(root);
|
||||
failed = 1;
|
||||
calc_enterpath(name);
|
||||
strcpy(errmsg, "Directory empty.");
|
||||
goto calc_fail;
|
||||
}
|
||||
|
|
@ -498,6 +494,10 @@ int calc_process() {
|
|||
/* something went wrong... */
|
||||
freedir(root);
|
||||
calc_fail:
|
||||
if(!path[1] && strcmp(name, "."))
|
||||
free(name);
|
||||
free(path);
|
||||
|
||||
while(failed && !input_handle(0))
|
||||
;
|
||||
if(orig == NULL)
|
||||
|
|
|
|||
Loading…
Reference in a new issue