Return a copy of the full filename of a flist entry, using the indicated * buffer or one of 5 static buffers if fbuf is NULL. No size-checking is * done because we checked the size when creating the file_struct entry. */
| 3393 | * done because we checked the size when creating the file_struct entry. |
| 3394 | */ |
| 3395 | char *f_name(const struct file_struct *f, char *fbuf) |
| 3396 | { |
| 3397 | if (!f || !F_IS_ACTIVE(f)) |
| 3398 | return NULL; |
| 3399 | |
| 3400 | if (!fbuf) |
| 3401 | fbuf = f_name_buf(); |
| 3402 | |
| 3403 | if (f->dirname) { |
| 3404 | int len = strlen(f->dirname); |
| 3405 | memcpy(fbuf, f->dirname, len); |
| 3406 | fbuf[len] = '/'; |
| 3407 | strlcpy(fbuf + len + 1, f->basename, MAXPATHLEN - (len + 1)); |
| 3408 | } else |
| 3409 | strlcpy(fbuf, f->basename, MAXPATHLEN); |
| 3410 | |
| 3411 | return fbuf; |
| 3412 | } |
| 3413 | |
| 3414 | /* Do a non-recursive scan of the named directory, possibly ignoring all |
| 3415 | * exclude rules except for the daemon's. If "dlen" is >=0, it is the length |
no test coverage detected