]> granicus.if.org Git - file/commitdiff
remove wrong conversion to strlcpy/strlcat. Cygwin does not need this anymore
authorChristos Zoulas <christos@zoulas.com>
Fri, 20 Feb 2009 15:19:20 +0000 (15:19 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 20 Feb 2009 15:19:20 +0000 (15:19 +0000)
since the open transparently adds .exe for > 1.7.

src/magic.c

index 14f51e5bb101a2df4494be473236393906ddc225..6d3896503097d730073e9bb1dd617e2c5623ea4c 100644 (file)
@@ -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) {