[File] [PATCH] Fix processing g-ir typelib files on big-endian platforms

Michael Catanzaro mcatanzaro at redhat.com
Sun Jun 21 23:31:19 UTC 2020


Hi,

On big-endian platforms, file prints incorrect results when processing
gobject-introspection typelib files, e.g.:

G-IR binary database, v4.0, 35072 entries/17664 local

Whereas on little-endian platforms, the results are correct:

G-IR binary database, v4.0, 137 entries/69 local

Notice that:

137 == 0x0089, 35072 == 0x8900
69 == 0x0045, 17664 == 0x4500

So the values are stored in host byte order.

Signed-off-by: Michael Catanzaro <mcatanzaro at gnome.org>
---
 magic/Magdir/gnome | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/magic/Magdir/gnome b/magic/Magdir/gnome
index 2905340c..ddf45957 100644
--- a/magic/Magdir/gnome
+++ b/magic/Magdir/gnome
@@ -55,5 +55,5 @@
 0 string GOBJ\nMETADATA\r\n\032 G-IR binary database
 >16 byte x \b, v%d
 >17 byte x \b.%d
->20 leshort x \b, %d entries
->22 leshort x \b/%d local
+>20 short x \b, %d entries
+>22 short x \b/%d local




More information about the File mailing list