summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristos Zoulas <christos@zoulas.com>2017-02-17 17:34:43 +0000
committerChristos Zoulas <christos@zoulas.com>2017-02-17 17:34:43 +0000
commitd3b30e2fb87bb6d58c60b2d178dc5657cce61727 (patch)
tree0faaa81db3617634d1cf0fee4beb88d2fe344d05
parent50b75abad3345fed90d0d36bf14e5d05e7d9d220 (diff)
downloadfile-git-d3b30e2fb87bb6d58c60b2d178dc5657cce61727.tar.gz
ignore files that start with '.'
-rw-r--r--src/apprentice.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/apprentice.c b/src/apprentice.c
index 9262ff3d..04c41539 100644
--- a/src/apprentice.c
+++ b/src/apprentice.c
@@ -32,7 +32,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: apprentice.c,v 1.258 2017/02/10 18:14:01 christos Exp $")
+FILE_RCSID("@(#)$File: apprentice.c,v 1.259 2017/02/17 17:34:43 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -1316,6 +1316,8 @@ apprentice_load(struct magic_set *ms, const char *fn, int action)
goto out;
}
while ((d = readdir(dir)) != NULL) {
+ if (d->d_name[0] == '.')
+ continue;
if (asprintf(&mfn, "%s/%s", fn, d->d_name) < 0) {
file_oomem(ms,
strlen(fn) + strlen(d->d_name) + 2);