Remove st != NULL checks from recursor functions
In the description of3111908b03
, it says that the functions must be able to handle st being NULL, but recurse always passes a valid pointer. The only function that was ever passed NULL was rm(), but this was changed to go through recurse in2f4ab52739
, so now the checks are pointless.
This commit is contained in:
committed by
Anselm R Garbe
parent
af392d1a76
commit
a5612b0d08
6
du.c
6
du.c
@@ -39,11 +39,11 @@ du(const char *path, struct stat *st, void *total, struct recursor *r)
|
||||
{
|
||||
off_t subtotal = 0;
|
||||
|
||||
if (st && S_ISDIR(st->st_mode))
|
||||
if (S_ISDIR(st->st_mode))
|
||||
recurse(path, &subtotal, r);
|
||||
*((off_t *)total) += subtotal + nblks(st ? st->st_blocks : 0);
|
||||
*((off_t *)total) += subtotal + nblks(st->st_blocks);
|
||||
|
||||
if (!sflag && r->depth <= maxdepth && r->depth && st && (S_ISDIR(st->st_mode) || aflag))
|
||||
if (!sflag && r->depth <= maxdepth && r->depth && (S_ISDIR(st->st_mode) || aflag))
|
||||
printpath(subtotal + nblks(st->st_blocks), path);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user