source: patches/file-5.00-fixes-1.patch@ 96c683b

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 96c683b was e244b2a, checked in by Jim Gifford <clfs@…>, 16 years ago

Fix File UTF-8 Issues

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[e244b2a]1Submitted by: Jim Gifford (jim at cross-lfs dot org)
2Date: 2009-12-16
3Initial Package Version: 5.00
4Upstream Status: Already Applied
5Origin: Jim Gifford
6Description: Fixes Various Build Issues in File
7 Localization Fixes
8
9diff -Naur file-5.00.orig/magic/Magdir/msdos file-5.00/magic/Magdir/msdos
10--- file-5.00.orig/magic/Magdir/msdos 2008-12-12 13:04:45.000000000 -0800
11+++ file-5.00/magic/Magdir/msdos 2009-02-16 20:28:57.440188294 -0800
12@@ -294,22 +294,37 @@
13 >10 string >\x23
14 >>10 string !\x2e
15 >>>17 string <\x5B
16->>>>10 string x \b, name: %.8s
17-#UDMA.SYS KEYB.SYS CMD640X2.SYS
18+>>>>10 string CMD640X2.SYS \b, name: %.8s
19+#UDMA.SYS
20 >10 string <\x41
21 >>12 string >\x40
22 >>>10 string !$
23->>>>12 string x \b, name: %.8s
24-#BTCDROM.SYS ASPICD.SYS
25+>>>>12 string UDMA.SYS \b, name: %.8s
26+#CMD640X2.SYS
27+>10 string <\x41
28+>>12 string >\x40
29+>>>10 string !$
30+>>>>12 string CMD640X2.SYS \b, name: %.8s
31+#KEYB.SYS
32+>10 string <\x41
33+>>12 string >\x40
34+>>>10 string !$
35+>>>>12 string KEYB.SYS \b, name: %.8s
36+#BTCDROM.SYS
37+>22 string >\x40
38+>>22 string <\x5B
39+>>>23 string <\x5B
40+>>>>22 string BTCDROM.SYS \b, name: %.8s
41+#ASPICD.SYS
42 >22 string >\x40
43 >>22 string <\x5B
44 >>>23 string <\x5B
45->>>>22 string x \b, name: %.8s
46+>>>>22 string ASPICD.SYS \b, name: %.8s
47 #ATAPICD.SYS
48 >76 string \0
49 >>77 string >\x40
50 >>>77 string <\x5B
51->>>>77 string x \b, name: %.8s
52+>>>>77 string ATAPICD.SYS \b, name: %.8s
53 # test too generic ?
54 0 byte 0x8c DOS executable (COM)
55 # updated by Joerg Jenderek at Oct 2008
56diff -Naur file-5.00.orig/src/readcdf.c file-5.00/src/readcdf.c
57--- file-5.00.orig/src/readcdf.c 2009-02-03 12:27:51.000000000 -0800
58+++ file-5.00/src/readcdf.c 2009-02-16 20:29:17.397467243 -0800
59@@ -75,9 +75,23 @@
60 if (len > 1) {
61 s = info[i].pi_str.s_buf;
62 if (NOTMIME(ms)) {
63- if (file_printf(ms, ", %s: %.*s", buf,
64- len, s) == -1)
65- return -1;
66+ char vbuf[1024];
67+ size_t j;
68+ for (j = 0; j < sizeof(vbuf) && len--;
69+ j++, s++) {
70+ if (*s == '\0')
71+ break;
72+ if (isprint((unsigned char)*s))
73+ vbuf[j] = *s;
74+ }
75+ if (j == sizeof(vbuf))
76+ --j;
77+ vbuf[j] = '\0';
78+ if (vbuf[0]) {
79+ if (file_printf(ms, ", %s: %s",
80+ buf, vbuf) == -1)
81+ return -1;
82+ }
83 } else if (info[i].pi_id ==
84 CDF_PROPERTY_NAME_OF_APPLICATION) {
85 if (strstr(s, "Word"))
86
Note: See TracBrowser for help on using the repository browser.