diff options
Diffstat (limited to 'src/librc')
-rw-r--r-- | src/librc/librc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librc/librc.c b/src/librc/librc.c index 03448e79..8f043131 100644 --- a/src/librc/librc.c +++ b/src/librc/librc.c @@ -101,7 +101,9 @@ ls_dir(const char *dir, int options) continue; } if (options & LS_DIR) { - if (stat(d->d_name, &buf) == 0 && + snprintf(file, sizeof(file), "%s/%s", + dir, d->d_name); + if (stat(file, &buf) != 0 || !S_ISDIR(buf.st_mode)) continue; } |