From 4c5f6c1ca4677be9ac118071415b883c34ea489f Mon Sep 17 00:00:00 2001 From: Daniel Novotny Date: Mon, 16 Feb 2009 15:21:15 +0000 Subject: [PATCH] fix #485141 --- file-5.00-non-english-word.patch | 30 ++++++++++++++++++++++++++++++ file.spec | 8 +++++++- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 file-5.00-non-english-word.patch diff --git a/file-5.00-non-english-word.patch b/file-5.00-non-english-word.patch new file mode 100644 index 0000000..17bb1b6 --- /dev/null +++ b/file-5.00-non-english-word.patch @@ -0,0 +1,30 @@ +--- file-5.00/src/readcdf.c 3 Feb 2009 20:27:51 -0000 1.11 ++++ file-5.00/src/readcdf.c 13 Feb 2009 18:45:33 -0000 +@@ -75,9 +75,23 @@ + if (len > 1) { + s = info[i].pi_str.s_buf; + if (NOTMIME(ms)) { +- if (file_printf(ms, ", %s: %.*s", buf, +- len, s) == -1) +- return -1; ++ char vbuf[1024]; ++ size_t j; ++ for (j = 0; j < sizeof(vbuf) && len--; ++ j++, s++) { ++ if (*s == '\0') ++ break; ++ if (isprint((unsigned char)*s)) ++ vbuf[j] = *s; ++ } ++ if (j == sizeof(vbuf)) ++ --j; ++ vbuf[j] = '\0'; ++ if (vbuf[0]) { ++ if (file_printf(ms, ", %s: %s", ++ buf, vbuf) == -1) ++ return -1; ++ } + } else if (info[i].pi_id == + CDF_PROPERTY_NAME_OF_APPLICATION) { + if (strstr(s, "Word")) + diff --git a/file.spec b/file.spec index 4cb7389..d791775 100644 --- a/file.spec +++ b/file.spec @@ -5,13 +5,14 @@ Summary: A utility for determining file types Name: file Version: 5.00 -Release: 1%{?dist} +Release: 2%{?dist} License: BSD Group: Applications/File Source0: ftp://ftp.astron.com/pub/file/file-%{version}.tar.gz URL: http://www.darwinsys.com/file/ Patch0: file-4.21-pybuild.patch Patch1: file-5.00-devdrv.patch +Patch2: file-5.00-non-english-word.patch Requires: file-libs = %{version}-%{release} BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -60,6 +61,8 @@ file(1) command. %patch0 -p1 #fixes #463809 %patch1 -p1 +#fixes #485141 +%patch2 -p1 iconv -f iso-8859-1 -t utf-8 < doc/libmagic.man > doc/libmagic.man_ touch -r doc/libmagic.man doc/libmagic.man_ @@ -133,6 +136,9 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Mon Feb 16 2009 Daniel Novotny 5.00-2 +- fix #485141 - rpm failed while checking a French Word file + * Mon Feb 09 2009 Daniel Novotny 5.00-1 - upgrade to 5.00 - drop upstreamed patches, rebase remaining patch