From: Christos Zoulas Date: Tue, 10 Aug 2010 09:53:32 +0000 (+0000) Subject: fix bug in previous. X-Git-Tag: FILE5_07~140 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=54defef5a1c59814f373a94329f18c2072677ad7;p=file fix bug in previous. --- diff --git a/src/magic.c b/src/magic.c index bdbff715..0a65601d 100644 --- a/src/magic.c +++ b/src/magic.c @@ -33,7 +33,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: magic.c,v 1.65 2009/09/14 17:50:38 christos Exp $") +FILE_RCSID("@(#)$File: magic.c,v 1.66 2010/07/21 16:47:17 christos Exp $") #endif /* lint */ #include "magic.h" @@ -99,7 +99,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, { if (dllpath[0] == 0 && GetModuleFileNameA(hinstDLL, dllpath, MAX_PATH) != 0) - PathRemoveFileSpec(dllpath); + PathRemoveFileSpecA(dllpath); return TRUE; } #endif @@ -107,7 +107,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, private const char * get_default_magic(void) { - static const char hmagic[] = "/.magic"; + static const char hmagic[] = "/.magic/magic.mgc"; static char default_magic[2 * MAXPATHLEN + 2]; char *home; char hmagicpath[MAXPATHLEN + 1] = {0}; @@ -302,6 +302,14 @@ magic_check(struct magic_set *ms, const char *magicfile) return ml ? 0 : -1; } +public int +magic_list(struct magic_set *ms, const char *magicfile) +{ + struct mlist *ml = file_apprentice(ms, magicfile, FILE_LIST); + free_mlist(ml); + return ml ? 0 : -1; +} + private void close_and_restore(const struct magic_set *ms, const char *name, int fd, const struct stat *sb)