diff options
author | phk <phk@FreeBSD.org> | 1996-11-16 22:05:46 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1996-11-16 22:05:46 +0000 |
commit | f0c019885aa60e31c36721c1c903be9faf56ae86 (patch) | |
tree | 68c5a09860683535e8bd319cfe2df1c607f87c29 /usr.sbin/ctm | |
parent | 8f3378d1da3b956a14549eb4ed5f192b6c857307 (diff) | |
download | FreeBSD-src-f0c019885aa60e31c36721c1c903be9faf56ae86.zip FreeBSD-src-f0c019885aa60e31c36721c1c903be9faf56ae86.tar.gz |
Check bogus and ignore against the relative name, not the absolute.
Diffstat (limited to 'usr.sbin/ctm')
-rw-r--r-- | usr.sbin/ctm/mkCTM/mkctm.c | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/usr.sbin/ctm/mkCTM/mkctm.c b/usr.sbin/ctm/mkCTM/mkctm.c index 117542f..af96cdc 100644 --- a/usr.sbin/ctm/mkCTM/mkctm.c +++ b/usr.sbin/ctm/mkCTM/mkctm.c @@ -372,36 +372,38 @@ void GetNext(int *i, int *n, struct dirent **nl, const char *dir, const char *name, u_long *ignored, u_long *bogus, u_long *wrong) { char buf[BUFSIZ]; + char buf1[BUFSIZ]; for (;;) { for (;;) { (*i)++; if (*i >= *n) return; - *buf = 0; - if (*dir != '/') - strcat(buf, "/"); - strcat(buf, dir); - if (buf[strlen(buf)-1] != '/') - strcat(buf, "/"); - strcat(buf, name); - if (buf[strlen(buf)-1] != '/') - strcat(buf, "/"); - strcat(buf, nl[*i]->d_name); + strcpy(buf1, name); + if (buf1[strlen(buf1)-1] != '/') + strcat(buf1, "/"); + strcat(buf1, nl[*i]->d_name); if (flag_ignore && - !regexec(®_ignore, buf, 0, 0, 0)) { + !regexec(®_ignore, buf1, 0, 0, 0)) { (*ignored)++; - fprintf(logf, "Ignore %s\n", buf); + fprintf(logf, "Ignore %s\n", buf1); if (verbose > 2) { - fprintf(stderr, "Ignore %s\n", buf); + fprintf(stderr, "Ignore %s\n", buf1); } } else if (flag_bogus && - !regexec(®_bogus, buf, 0, 0, 0)) { + !regexec(®_bogus, buf1, 0, 0, 0)) { (*bogus)++; - fprintf(logf, "Bogus %s\n", buf); - fprintf(stderr, "Bogus %s\n", buf); + fprintf(logf, "Bogus %s\n", buf1); + fprintf(stderr, "Bogus %s\n", buf1); damage++; } else { + *buf = 0; + if (*dir != '/') + strcat(buf, "/"); + strcat(buf, dir); + if (buf[strlen(buf)-1] != '/') + strcat(buf, "/"); + strcat(buf, buf1); break; } free(nl[*i]); nl[*i] = 0; |