Deleted Added
full compact
mkctm.c (19813) mkctm.c (19816)
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];
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];
375
376 for (;;) {
377 for (;;) {
378 (*i)++;
379 if (*i >= *n)
380 return;
376
377 for (;;) {
378 for (;;) {
379 (*i)++;
380 if (*i >= *n)
381 return;
381 *buf = 0;
382 if (*dir != '/')
383 strcat(buf, "/");
384 strcat(buf, dir);
385 if (buf[strlen(buf)-1] != '/')
386 strcat(buf, "/");
387 strcat(buf, name);
388 if (buf[strlen(buf)-1] != '/')
389 strcat(buf, "/");
390 strcat(buf, nl[*i]->d_name);
382 strcpy(buf1, name);
383 if (buf1[strlen(buf1)-1] != '/')
384 strcat(buf1, "/");
385 strcat(buf1, nl[*i]->d_name);
391 if (flag_ignore &&
386 if (flag_ignore &&
392 !regexec(®_ignore, buf, 0, 0, 0)) {
387 !regexec(&reg_ignore, buf1, 0, 0, 0)) {
393 (*ignored)++;
388 (*ignored)++;
394 fprintf(logf, "Ignore %s\n", buf);
389 fprintf(logf, "Ignore %s\n", buf1);
395 if (verbose > 2) {
390 if (verbose > 2) {
396 fprintf(stderr, "Ignore %s\n", buf);
391 fprintf(stderr, "Ignore %s\n", buf1);
397 }
398 } else if (flag_bogus &&
392 }
393 } else if (flag_bogus &&
399 !regexec(®_bogus, buf, 0, 0, 0)) {
394 !regexec(&reg_bogus, buf1, 0, 0, 0)) {
400 (*bogus)++;
395 (*bogus)++;
401 fprintf(logf, "Bogus %s\n", buf);
402 fprintf(stderr, "Bogus %s\n", buf);
396 fprintf(logf, "Bogus %s\n", buf1);
397 fprintf(stderr, "Bogus %s\n", buf1);
403 damage++;
404 } else {
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);
405 break;
406 }
407 free(nl[*i]); nl[*i] = 0;
408 }
409 /* If the filesystem didn't tell us, find type */
410 if (nl[*i]->d_type == DT_UNKNOWN)
411 nl[*i]->d_type = IFTODT(StatFile(buf)->st_mode);
412 if (nl[*i]->d_type == DT_REG || nl[*i]->d_type == DT_DIR)

--- 180 unchanged lines hidden ---
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 ---