|
Lines 446-472
consider_visiting(FTS *p, FTSENT *ent)
Link Here
|
| 446 |
} |
446 |
} |
| 447 |
else if (ent->fts_info == FTS_NS) |
447 |
else if (ent->fts_info == FTS_NS) |
| 448 |
{ |
448 |
{ |
| 449 |
if (ent->fts_level == 0) |
449 |
error(0, ent->fts_errno, "%s", |
| 450 |
{ |
450 |
safely_quote_err_filename(0, ent->fts_path)); |
| 451 |
/* e.g., nonexistent starting point */ |
451 |
error_severity(1); |
| 452 |
error(0, ent->fts_errno, "%s", |
452 |
/* Continue despite the error, as file name without stat info |
| 453 |
safely_quote_err_filename(0, ent->fts_path)); |
453 |
* might be better than not even processing the file name. This |
| 454 |
error_severity(1); /* remember problem */ |
454 |
* can lead to repeated error messages later on, though, if a |
| 455 |
return; |
455 |
* predicate requires stat information. |
| 456 |
} |
456 |
* |
| 457 |
else |
457 |
* Not printing an error message here would be even more wrong, |
| 458 |
{ |
458 |
* though, as this could cause the contents of a directory to be |
| 459 |
/* The following if statement fixes Savannah bug #19605 |
459 |
* silently ignored, as the directory wouldn't be identified as |
| 460 |
* (failure to diagnose a symbolic link loop) |
460 |
* such. |
| 461 |
*/ |
461 |
*/ |
| 462 |
if (symlink_loop(ent->fts_accpath)) |
|
|
| 463 |
{ |
| 464 |
error(0, ELOOP, "%s", |
| 465 |
safely_quote_err_filename(0, ent->fts_path)); |
| 466 |
error_severity(1); |
| 467 |
return; |
| 468 |
} |
| 469 |
} |
| 470 |
} |
462 |
} |
| 471 |
|
463 |
|
| 472 |
/* Cope with the usual cases. */ |
464 |
/* Cope with the usual cases. */ |
|
Lines 474-480
consider_visiting(FTS *p, FTSENT *ent)
Link Here
|
| 474 |
|| ent->fts_info == FTS_NS /* e.g. symlink loop */) |
466 |
|| ent->fts_info == FTS_NS /* e.g. symlink loop */) |
| 475 |
{ |
467 |
{ |
| 476 |
assert (!state.have_stat); |
468 |
assert (!state.have_stat); |
| 477 |
assert (ent->fts_info == FTS_NSOK || state.type != 0); |
469 |
assert (ent->fts_info == FTS_NSOK || state.type == 0); |
| 478 |
mode = state.type; |
470 |
mode = state.type; |
| 479 |
} |
471 |
} |
| 480 |
else |
472 |
else |