]> granicus.if.org Git - file/commitdiff
Cygwin patches from Corinna
authorChristos Zoulas <christos@zoulas.com>
Sat, 27 Aug 2005 08:12:19 +0000 (08:12 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sat, 27 Aug 2005 08:12:19 +0000 (08:12 +0000)
ChangeLog
src/Makefile.am
src/Makefile.in
src/magic.c

index 1c0a44b5e5a8b68eb79667fca62e06d9c5731ba7..fc25280ac8bd6b7be2ab697539912ae3c006d347 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+
+2005-08-27 04:09 Christos Zoulas <christos@zoulas.com>
+
+       * Cygwin changes Corinna Vinschen
+
 2005-08-18 09:53 Christos Zoulas <christos@zoulas.com>
 
        * Remove erroreous mention of /etc/magic in the file man page
index c88d4b55f7d42138195ea410746ad6c25c6aabf9..4a941380f53b88f3d004e51f6b484a957d89c20f 100644 (file)
@@ -10,7 +10,7 @@ AM_CPPFLAGS = -DMAGIC='"$(MAGIC)"'
 libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
        compress.c is_tar.c readelf.c print.c fsmagic.c \
        funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c
-libmagic_la_LDFLAGS = -version-info 1:0:0
+libmagic_la_LDFLAGS = -no-undefined -version-info 1:0:0
 
 file_SOURCES = file.c
 file_LDADD = libmagic.la
index 1d3d65d73ee415d12d405c65e0757532f3821ff0..7f7ff53e538ed92f90d2a3b74f04c15fdc118d2c 100644 (file)
@@ -203,7 +203,7 @@ libmagic_la_SOURCES = magic.c apprentice.c softmagic.c ascmagic.c \
        compress.c is_tar.c readelf.c print.c fsmagic.c \
        funcs.c file.h names.h patchlevel.h readelf.h tar.h apptype.c
 
-libmagic_la_LDFLAGS = -version-info 1:0:0
+libmagic_la_LDFLAGS = -no-undefined -version-info 1:0:0
 file_SOURCES = file.c
 file_LDADD = libmagic.la
 all: all-am
index de2c618c47f4dba8cf4de939202182289546bb7c..06afddcbab8ac833329032953642f6040abd1cba 100644 (file)
@@ -63,7 +63,7 @@
 #include "patchlevel.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: magic.c,v 1.28 2005/06/25 15:52:14 christos Exp $")
+FILE_RCSID("@(#)$Id: magic.c,v 1.29 2005/08/27 08:12:19 christos Exp $")
 #endif /* lint */
 
 #ifdef __EMX__
@@ -243,6 +243,11 @@ magic_file(struct magic_set *ms, const char *inname)
        if (inname == NULL)
                fd = STDIN_FILENO;
        else if ((fd = open(inname, O_RDONLY)) < 0) {
+#ifdef __CYGWIN__
+           char *tmp = alloca(strlen(inname) + 5);
+           (void)strcat(strcpy(tmp, inname), ".exe");
+           if ((fd = open(tmp, O_RDONLY)) < 0) {
+#endif
                /* We cannot open it, but we were able to stat it. */
                if (sb.st_mode & 0222)
                        if (file_printf(ms, "writable, ") == -1)
@@ -257,6 +262,9 @@ magic_file(struct magic_set *ms, const char *inname)
                        goto done;
                rv = 0;
                goto done;
+#ifdef __CYGWIN__
+           }
+#endif
        }
 
        /*