1/* Still missing: 2 * 3 * mkctm 4 * -B regex Bogus 5 * -I regex Ignore 6 * -D int Damage 7 * -q decrease verbosity 8 * -v increase verbosity --- 358 unchanged lines hidden (view full) --- 367 s_del_bytes += StatFile(buf1)->st_size; 368 } 369} 370 371void 372GetNext(int *i, int *n, struct dirent **nl, const char *dir, const char *name, u_long *ignored, u_long *bogus, u_long *wrong) 373{ 374 char buf[BUFSIZ]; |
375 char buf1[BUFSIZ]; |
376 377 for (;;) { 378 for (;;) { 379 (*i)++; 380 if (*i >= *n) 381 return; |
382 strcpy(buf1, name); 383 if (buf1[strlen(buf1)-1] != '/') 384 strcat(buf1, "/"); 385 strcat(buf1, nl[*i]->d_name); |
386 if (flag_ignore && |
387 !regexec(®_ignore, buf1, 0, 0, 0)) { |
388 (*ignored)++; |
389 fprintf(logf, "Ignore %s\n", buf1); |
390 if (verbose > 2) { |
391 fprintf(stderr, "Ignore %s\n", buf1); |
392 } 393 } else if (flag_bogus && |
394 !regexec(®_bogus, buf1, 0, 0, 0)) { |
395 (*bogus)++; |
396 fprintf(logf, "Bogus %s\n", buf1); 397 fprintf(stderr, "Bogus %s\n", buf1); |
398 damage++; 399 } else { |
400 *buf = 0; 401 if (*dir != '/') 402 strcat(buf, "/"); 403 strcat(buf, dir); 404 if (buf[strlen(buf)-1] != '/') 405 strcat(buf, "/"); 406 strcat(buf, buf1); |
407 break; 408 } 409 free(nl[*i]); nl[*i] = 0; 410 } 411 /* If the filesystem didn't tell us, find type */ 412 if (nl[*i]->d_type == DT_UNKNOWN) 413 nl[*i]->d_type = IFTODT(StatFile(buf)->st_mode); 414 if (nl[*i]->d_type == DT_REG || nl[*i]->d_type == DT_DIR) --- 180 unchanged lines hidden --- |