ref: 5b81e7de3f1ab3691438878cf1da912a54138d5f
parent: 3f1fefeafbb90309b712d70144a4a95874d48a56
author: BurnZeZ <devnull@localhost>
date: Sat Mar 30 11:10:36 EDT 2019
walk: remove unused depth argument from dofile()
--- a/sys/src/cmd/walk.c
+++ b/sys/src/cmd/walk.c
@@ -40,12 +40,10 @@
}
void
-dofile(char *path, Dir *f, int pathonly, long depth)
+dofile(char *path, Dir *f, int pathonly)
{
char *p;
- USED(depth);
-
if(
(f == dotdir)
|| (tflag && ! (f->qid.type & QTTMP))
@@ -115,12 +113,12 @@
continue;
if(! (f->qid.type & QTDIR)){
if(fflag && depth >= mindepth)
- dofile(path, f, 0, depth);
+ dofile(path, f, 0);
} else if(strcmp(f->name, ".") == 0 || strcmp(f->name, "..") == 0){
warn(". or .. named file: %s/%s", path, f->name);
} else{
if(depth+1 > maxdepth){
- dofile(path, f, 0, depth);
+ dofile(path, f, 0);
continue;
} else if(path == dotpath){
if((file = s_new()) == nil)
@@ -146,7 +144,7 @@
nodescend:
depth--;
if(dflag && depth >= mindepth)
- dofile(path, cf, 0, depth);
+ dofile(path, cf, 0);
}
char*
@@ -272,7 +270,7 @@
}
if((d = dirstat(argv[i])) != nil && ! (d->qid.type & QTDIR)){
if(fflag && !seen(d) && mindepth < 1)
- dofile(argv[i], d, 1, 0);
+ dofile(argv[i], d, 1);
} else
walk(argv[i], d, 1);
free(d);