From: Christos Zoulas Date: Thu, 27 Mar 2003 19:09:57 +0000 (+0000) Subject: fix reversed symlink test. X-Git-Tag: FILE4_02~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62879d39fb4862cf30d5917b9f824e7370478fce;p=file fix reversed symlink test. --- diff --git a/src/fsmagic.c b/src/fsmagic.c index bde65823..e4916d70 100644 --- a/src/fsmagic.c +++ b/src/fsmagic.c @@ -62,7 +62,7 @@ #undef HAVE_MAJOR #ifndef lint -FILE_RCSID("@(#)$Id: fsmagic.c,v 1.39 2003/03/26 16:31:20 christos Exp $") +FILE_RCSID("@(#)$Id: fsmagic.c,v 1.40 2003/03/27 19:09:57 christos Exp $") #endif /* lint */ protected int @@ -78,14 +78,14 @@ file_fsmagic(struct magic_set *ms, const char *fn, struct stat *sb) * On 4.2BSD and similar systems, use lstat() to identify symlinks. */ #ifdef S_IFLNK - if ((ms->flags & MAGIC_SYMLINK) != 0) + if ((ms->flags & MAGIC_SYMLINK) == 0) ret = lstat(fn, sb); else #endif ret = stat(fn, sb); /* don't merge into if; see "ret =" above */ if (ret) { - if (file_printf(ms, "can't stat `%s' (%s)", + if (file_printf(ms, "Can't stat `%s' (%s)", fn, strerror(errno)) == -1) return -1; return 1;