version 1.5, 1997/06/30 23:54:07 |
version 1.6, 1999/10/03 19:07:35 |
|
|
err(1, "ftsopen"); |
err(1, "ftsopen"); |
|
|
while ((entry = fts_read(tree))) { |
while ((entry = fts_read(tree))) { |
switch(entry->fts_info) { |
switch (entry->fts_info) { |
case FTS_D: |
case FTS_D: |
if (isdepth) |
if (isdepth) |
continue; |
continue; |
|
|
warnx("%s: illegal path", entry->fts_path); |
warnx("%s: illegal path", entry->fts_path); |
continue; |
continue; |
} |
} |
|
|
|
/* |
|
* Since fts does not chdir for the root node we |
|
* have to do this ourselves to make -execdir work. |
|
*/ |
|
if (entry->fts_level == FTS_ROOTLEVEL) |
|
chdir(entry->fts_accpath); |
|
|
/* |
/* |
* call all the functions in the execution plan until one is |
* Call all the functions in the execution plan until one is |
* false or all have been executed. This is where we do all |
* false or all have been executed. This is where we do all |
* the work specified by the user on the command line. |
* the work specified by the user on the command line. |
*/ |
*/ |
for (p = plan; p && (p->eval)(p, entry); p = p->next); |
for (p = plan; p && (p->eval)(p, entry); p = p->next) |
|
; |
|
|
|
/* Undo the chdir above to make fts happy. */ |
|
if (entry->fts_level == FTS_ROOTLEVEL) |
|
fchdir(tree->fts_rfd); |
} |
} |
(void)fts_close(tree); |
(void)fts_close(tree); |
} |
} |