summaryrefslogtreecommitdiff
path: root/src/magic.c
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2016-11-07 07:26:06 +0000
committerXin LI <delphij@FreeBSD.org>2016-11-07 07:26:06 +0000
commit46a30e2e108c3996f8c1ef41888011c2a5cedaf7 (patch)
treed5b3320c0abb93ce4b48892c8cf3704e4a3ed009 /src/magic.c
parent581c312f134935d421daea8ff9efe57e66a2beab (diff)
Diffstat (limited to 'src/magic.c')
-rw-r--r--src/magic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/magic.c b/src/magic.c
index a256c42f944c..b61ad29d7a5d 100644
--- a/src/magic.c
+++ b/src/magic.c
@@ -33,7 +33,7 @@
#include "file.h"
#ifndef lint
-FILE_RCSID("@(#)$File: magic.c,v 1.99 2016/05/03 16:09:38 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.100 2016/07/18 11:43:05 christos Exp $")
#endif /* lint */
#include "magic.h"
@@ -492,7 +492,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
if (r < PIPE_BUF) break;
}
- if (nbytes == 0) {
+ if (nbytes == 0 && inname) {
/* We can not read it, but we were able to stat it. */
if (unreadable_info(ms, sb.st_mode, inname) == -1)
goto done;