Browse Source

Fix --mime-encoding. Closes: #799690

Christoph Biedl 8 years ago
parent
commit
83bf50f0c6

+ 21 - 0
debian/patches/cherry-pick.FILE5_25-12-gc83b058.fix-mime-encoding-without-mime-type.patch

@@ -0,0 +1,21 @@
+Subject: Fix --mime-encoding without --mime-type
+Origin: FILE5_25-12-gc83b058
+Upstream-Author: Christos Zoulas <christos@zoulas.com>
+Date: Tue Sep 22 15:40:32 2015 +0000
+Bug-Debian: https://bugs.debian.org/799690
+
+    Fix --mime-encoding without --mime-type (Christoph Biedl)
+    printf '\x00\xff' | file --mime-encoding -
+
+--- a/src/funcs.c
++++ b/src/funcs.c
+@@ -294,7 +294,8 @@
+ 	/* give up */
+ 	m = 1;
+ 	if (ms->flags & MAGIC_MIME) {
+-		if (file_printf(ms, "%s", type) == -1)
++		if ((ms->flags & MAGIC_MIME_TYPE) &&
++		    file_printf(ms, "%s", type) == -1)
+ 			rv = -1;
+ 	} else if (ms->flags & MAGIC_APPLE) {
+ 		if (file_printf(ms, "UNKNUNKN") == -1)

+ 1 - 0
debian/patches/series

@@ -6,6 +6,7 @@ cherry-pick.FILE5_25-5-gba7b688.bump-more.patch
 cherry-pick.FILE5_25-6-gb72c33f.remove-over-zealous-and-fix-test-properly.patch
 cherry-pick.FILE5_25-7-g1052fe4.drop-the-count-of-digits-allowed.patch
 cherry-pick.FILE5_25-9-g9039ec5.make-the-default-case-print-something-sane-for-each-of-the-different-styles.patch
+cherry-pick.FILE5_25-12-gc83b058.fix-mime-encoding-without-mime-type.patch
 
 # local modifications
 local.support-local-definitions-in-etc-magic.patch