source:
patches/file-5.00-fixes-2.patch@
e963bf3
Last change on this file since e963bf3 was 1204c773, checked in by , 16 years ago | |
---|---|
|
|
File size: 5.2 KB |
-
magic/Magdir/msdos
Submitted by: Jim Gifford (jim at cross-lfs dot org) Date: 2009-03-01 Initial Package Version: 5.00 Upstream Status: Already Applied Origin: Jim Gifford Description: Fixes Various Build Issues in File Localization Fixes diff -Naur file-5.00.orig/magic/Magdir/msdos file-5.00/magic/Magdir/msdos
old new 294 294 >10 string >\x23 295 295 >>10 string !\x2e 296 296 >>>17 string <\x5B 297 >>>>10 string x\b, name: %.8s298 #UDMA.SYS KEYB.SYS CMD640X2.SYS297 >>>>10 string CMD640X2.SYS \b, name: %.8s 298 #UDMA.SYS 299 299 >10 string <\x41 300 300 >>12 string >\x40 301 301 >>>10 string !$ 302 >>>>12 string x \b, name: %.8s 303 #BTCDROM.SYS ASPICD.SYS 302 >>>>12 string UDMA.SYS \b, name: %.8s 303 #CMD640X2.SYS 304 >10 string <\x41 305 >>12 string >\x40 306 >>>10 string !$ 307 >>>>12 string CMD640X2.SYS \b, name: %.8s 308 #KEYB.SYS 309 >10 string <\x41 310 >>12 string >\x40 311 >>>10 string !$ 312 >>>>12 string KEYB.SYS \b, name: %.8s 313 #BTCDROM.SYS 314 >22 string >\x40 315 >>22 string <\x5B 316 >>>23 string <\x5B 317 >>>>22 string BTCDROM.SYS \b, name: %.8s 318 #ASPICD.SYS 304 319 >22 string >\x40 305 320 >>22 string <\x5B 306 321 >>>23 string <\x5B 307 >>>>22 string x\b, name: %.8s322 >>>>22 string ASPICD.SYS \b, name: %.8s 308 323 #ATAPICD.SYS 309 324 >76 string \0 310 325 >>77 string >\x40 311 326 >>>77 string <\x5B 312 >>>>77 string x\b, name: %.8s327 >>>>77 string ATAPICD.SYS \b, name: %.8s 313 328 # test too generic ? 314 329 0 byte 0x8c DOS executable (COM) 315 330 # updated by Joerg Jenderek at Oct 2008 -
src/cdf.c
diff -Naur file-5.00.orig/src/cdf.c file-5.00/src/cdf.c
old new 239 239 cdf_unpack_header(h, buf); 240 240 cdf_swap_header(h); 241 241 if (h->h_magic != CDF_MAGIC) { 242 DPRINTF(("Bad magic 0x%x != 0x$x\n", h->h_magic, CDF_MAGIC)); 242 DPRINTF(("Bad magic 0x%llx != 0x%llx\n", 243 (unsigned long long)h->h_magic, 244 (unsigned long long)CDF_MAGIC)); 243 245 errno = EFTYPE; 244 246 return -1; 245 247 } … … 539 541 if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_ROOT_STORAGE) 540 542 break; 541 543 544 /* If the it is not there, just fake it; some docs don't have it */ 542 545 if (i == dir->dir_len) { 543 DPRINTF(("Cannot find root storage node\n"));544 errno = EFTYPE;545 return -1;546 scn->sst_tab = NULL; 547 scn->sst_len = 0; 548 return 0; 546 549 } 547 550 d = &dir->dir_tab[i]; 548 551 -
src/readcdf.c
diff -Naur file-5.00.orig/src/readcdf.c file-5.00/src/readcdf.c
old new 75 75 if (len > 1) { 76 76 s = info[i].pi_str.s_buf; 77 77 if (NOTMIME(ms)) { 78 if (file_printf(ms, ", %s: %.*s", buf, 79 len, s) == -1) 80 return -1; 78 char vbuf[1024]; 79 size_t j; 80 for (j = 0; j < sizeof(vbuf) && len--; 81 j++, s++) { 82 if (*s == '\0') 83 break; 84 if (isprint((unsigned char)*s)) 85 vbuf[j] = *s; 86 } 87 if (j == sizeof(vbuf)) 88 --j; 89 vbuf[j] = '\0'; 90 if (vbuf[0]) { 91 if (file_printf(ms, ", %s: %s", 92 buf, vbuf) == -1) 93 return -1; 94 } 81 95 } else if (info[i].pi_id == 82 96 CDF_PROPERTY_NAME_OF_APPLICATION) { 83 97 if (strstr(s, "Word")) … … 115 129 case CDF_CLIPBOARD: 116 130 break; 117 131 default: 118 file_error(ms, 0, "Internal parsing error"); 132 #ifndef EFTYPE /* XXX: vapier: copied from cdf.c for now ... */ 133 #define EFTYPE EINVAL 134 #endif 135 errno = EFTYPE; 119 136 return -1; 120 137 } 121 138 } … … 188 205 cdf_stream_t sst, scn; 189 206 cdf_dir_t dir; 190 207 int i; 208 const char *expn = ""; 191 209 (void)&nbytes; 192 210 (void)&buf; 193 211 … … 200 218 #endif 201 219 202 220 if (cdf_read_sat(fd, &h, &sat) == -1) { 203 file_error(ms, errno, "Can't read SAT");221 expn = "Can't read SAT"; 204 222 return -1; 205 223 } 206 224 #ifdef CDF_DEBUG … … 208 226 #endif 209 227 210 228 if ((i = cdf_read_ssat(fd, &h, &sat, &ssat)) == -1) { 211 file_error(ms, errno, "Can't read SAT");229 expn = "Can't read SSAT"; 212 230 goto out1; 213 231 } 214 232 #ifdef CDF_DEBUG … … 216 234 #endif 217 235 218 236 if ((i = cdf_read_dir(fd, &h, &sat, &dir)) == -1) { 219 file_error(ms, errno, "Can't read directory");237 expn = "Can't read directory"; 220 238 goto out2; 221 239 } 222 240 223 241 if ((i = cdf_read_short_stream(fd, &h, &sat, &dir, &sst)) == -1) { 224 file_error(ms, errno, "Cannot read short stream");242 expn = "Cannot read short stream"; 225 243 goto out3; 226 244 } 227 245 … … 230 248 #endif 231 249 if ((i = cdf_read_summary_info(fd, &h, &sat, &ssat, &sst, &dir, &scn)) 232 250 == -1) { 233 /* Some files don't have summary info! */ 234 #ifdef notyet 235 file_error(ms, errno, "Can't read summary_info"); 236 #else 237 i = 0; 238 #endif 251 expn = ""; 239 252 goto out4; 240 253 } 241 254 #ifdef CDF_DEBUG 242 255 cdf_dump_summary_info(&h, &scn); 243 256 #endif 244 257 if ((i = cdf_file_summary_info(ms, &scn)) == -1) 245 file_error(ms, errno, "Can't expand summary_info");258 expn = "Can't expand summary_info"; 246 259 free(scn.sst_tab); 247 260 out4: 248 261 free(sst.sst_tab); … … 252 265 free(ssat.sat_tab); 253 266 out1: 254 267 free(sat.sat_tab); 268 if (i != 1) { 269 if (file_printf(ms, "CDF V2 Document") == -1) 270 return -1; 271 if (*expn) 272 if (file_printf(ms, ", corrupt: %s", expn) == -1) 273 return -1; 274 i = 1; 275 } 255 276 return i; 256 277 }
Note:
See TracBrowser
for help on using the repository browser.