| 1292 | } |
| 1293 | |
| 1294 | static void |
| 1295 | ADJUST(FTSENT* p, void* addr) |
| 1296 | { |
| 1297 | if ((p)->fts_accpath >= (p)->fts_path && |
| 1298 | (p)->fts_accpath < (p)->fts_path + (p)->fts_pathlen) { |
| 1299 | if (p->fts_accpath != p->fts_path) { |
| 1300 | errx(1, "fts ADJUST: accpath %p path %p", |
| 1301 | p->fts_accpath, p->fts_path); |
| 1302 | } |
| 1303 | if (p->fts_level != 0) { |
| 1304 | errx(1, "fts ADJUST: level %d not 0", p->fts_level); |
| 1305 | } |
| 1306 | (p)->fts_accpath = |
| 1307 | (char*)addr + ((p)->fts_accpath - (p)->fts_path); |
| 1308 | } |
| 1309 | (p)->fts_path = (char*)addr; |
| 1310 | } |
| 1311 | |
| 1312 | /* |
| 1313 | * When the path is realloc'd, have to fix all of the pointers in structures |