diff options
author | delphij <delphij@FreeBSD.org> | 2016-05-28 06:17:35 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2016-05-28 06:17:35 +0000 |
commit | 91ba1b1e4e9a4f9897c65479d05434356024147b (patch) | |
tree | 2f2ab8b6bef4f33da2b65712942db22ef56d2286 /contrib/file/src/readcdf.c | |
parent | 7c96bdb9c8a1295e7cd4f855d10ea5dffe1085ec (diff) | |
download | FreeBSD-src-91ba1b1e4e9a4f9897c65479d05434356024147b.zip FreeBSD-src-91ba1b1e4e9a4f9897c65479d05434356024147b.tar.gz |
MFC r298192,299234,299238,299736:
file 5.27.
Diffstat (limited to 'contrib/file/src/readcdf.c')
-rw-r--r-- | contrib/file/src/readcdf.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/contrib/file/src/readcdf.c b/contrib/file/src/readcdf.c index 99d8ec0..db8d3d3 100644 --- a/contrib/file/src/readcdf.c +++ b/contrib/file/src/readcdf.c @@ -26,7 +26,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: readcdf.c,v 1.53 2015/04/09 20:01:41 christos Exp $") +FILE_RCSID("@(#)$File: readcdf.c,v 1.57 2016/05/03 16:08:49 christos Exp $") #endif #include <assert.h> @@ -60,12 +60,16 @@ static const struct nv { { "Windows Installer", "vnd.ms-msi", }, { NULL, NULL, }, }, name2mime[] = { + { "Book", "vnd.ms-excel", }, + { "Workbook", "vnd.ms-excel", }, { "WordDocument", "msword", }, { "PowerPoint", "vnd.ms-powerpoint", }, { "DigitalSignature", "vnd.ms-msi", }, { NULL, NULL, }, }, name2desc[] = { - { "WordDocument", "Microsoft Office Word",}, + { "Book", "Microsoft Excel", }, + { "Workbook", "Microsoft Excel", }, + { "WordDocument", "Microsoft Word", }, { "PowerPoint", "Microsoft PowerPoint", }, { "DigitalSignature", "Microsoft Installer", }, { NULL, NULL, }, @@ -119,6 +123,8 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv) assert(c_lc_ctype != NULL); old_lc_ctype = uselocale(c_lc_ctype); assert(old_lc_ctype != NULL); +#else + char *old_lc_ctype = setlocale(LC_CTYPE, "C"); #endif for (i = 0; nv[i].pattern != NULL; i++) if (strcasestr(vbuf, nv[i].pattern) != NULL) { @@ -131,6 +137,8 @@ cdf_app_to_mime(const char *vbuf, const struct nv *nv) #ifdef USE_C_LOCALE (void)uselocale(old_lc_ctype); freelocale(c_lc_ctype); +#else + setlocale(LC_CTYPE, old_lc_ctype); #endif return rv; } @@ -365,7 +373,7 @@ cdf_file_catalog_info(struct magic_set *ms, const cdf_info_t *info, dir, "Catalog", scn)) == -1) return i; #ifdef CDF_DEBUG - cdf_dump_catalog(&h, &scn); + cdf_dump_catalog(&h, scn); #endif if ((i = cdf_file_catalog(ms, h, scn)) == -1) return -1; |