mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-13 09:18:40 -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 */
|
/* calculate */
|
||||||
n = calc_dir(root, name);
|
n = calc_dir(root, name);
|
||||||
|
|
||||||
/* free some resources */
|
|
||||||
if(!path[1] && strcmp(name, "."))
|
|
||||||
free(name);
|
|
||||||
free(path);
|
|
||||||
|
|
||||||
if(links) {
|
if(links) {
|
||||||
kh_destroy(hl, links);
|
kh_destroy(hl, links);
|
||||||
links = NULL;
|
links = NULL;
|
||||||
|
|
@ -473,6 +468,7 @@ int calc_process() {
|
||||||
if(root->sub == NULL) {
|
if(root->sub == NULL) {
|
||||||
freedir(root);
|
freedir(root);
|
||||||
failed = 1;
|
failed = 1;
|
||||||
|
calc_enterpath(name);
|
||||||
strcpy(errmsg, "Directory empty.");
|
strcpy(errmsg, "Directory empty.");
|
||||||
goto calc_fail;
|
goto calc_fail;
|
||||||
}
|
}
|
||||||
|
|
@ -498,6 +494,10 @@ int calc_process() {
|
||||||
/* something went wrong... */
|
/* something went wrong... */
|
||||||
freedir(root);
|
freedir(root);
|
||||||
calc_fail:
|
calc_fail:
|
||||||
|
if(!path[1] && strcmp(name, "."))
|
||||||
|
free(name);
|
||||||
|
free(path);
|
||||||
|
|
||||||
while(failed && !input_handle(0))
|
while(failed && !input_handle(0))
|
||||||
;
|
;
|
||||||
if(orig == NULL)
|
if(orig == NULL)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue