From: Christos Zoulas Date: Fri, 20 Feb 2009 15:19:20 +0000 (+0000) Subject: remove wrong conversion to strlcpy/strlcat. Cygwin does not need this anymore X-Git-Tag: FILE5_05~234 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=15e1a22f118f94bb10b4a87dd55307a65058460f;p=file remove wrong conversion to strlcpy/strlcat. Cygwin does not need this anymore since the open transparently adds .exe for > 1.7. --- diff --git a/src/magic.c b/src/magic.c index 14f51e5b..6d389650 100644 --- a/src/magic.c +++ b/src/magic.c @@ -28,7 +28,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.60 2009/02/04 18:24:32 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.61 2009/02/20 15:19:20 christos Exp $") #endif /* lint */ #include "magic.h" @@ -291,26 +291,10 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd) errno = 0; if ((fd = open(inname, flags)) < 0) { -#ifdef __CYGWIN__ - /* FIXME: Do this with EXEEXT from autotools */ - size_t len = strlen(inname) + 5; - char *tmp = alloca(len); - (void)strlcat(strlcpy(tmp, inname, len), ".exe", len); - if ((fd = open(tmp, flags)) < 0) { -#endif - if (unreadable_info(ms, sb.st_mode, -#ifdef __CYGWIN - tmp -#else - inname -#endif - ) == -1) - goto done; - rv = 0; + if (unreadable_info(ms, sb.st_mode, inname) == -1) goto done; -#ifdef __CYGWIN__ - } -#endif + rv = 0; + goto done; } #ifdef O_NONBLOCK if ((flags = fcntl(fd, F_GETFL)) != -1) {