From: Christos Zoulas Date: Sat, 27 Aug 2005 08:12:19 +0000 (+0000) Subject: Cygwin patches from Corinna X-Git-Tag: FILE4_16~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0674ddad3f63de588fff169f3347a0bffaa242c;p=file Cygwin patches from Corinna --- diff --git a/ChangeLog b/ChangeLog index 1c0a44b5..fc25280a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ + +2005-08-27 04:09 Christos Zoulas + + * Cygwin changes Corinna Vinschen + 2005-08-18 09:53 Christos Zoulas * Remove erroreous mention of /etc/magic in the file man page diff --git a/src/Makefile.am b/src/Makefile.am index c88d4b55..4a941380 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -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 diff --git a/src/Makefile.in b/src/Makefile.in index 1d3d65d7..7f7ff53e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -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 diff --git a/src/magic.c b/src/magic.c index de2c618c..06afddcb 100644 --- a/src/magic.c +++ b/src/magic.c @@ -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 } /*