1
0

patch-src_lfn_c 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. --- dosfstools-3.0.26.orig/src/lfn.c 2014-01-17 07:07:16.000000000 +0100
  2. +++ dosfstools-3.0.26/src/lfn.c 2014-03-26 13:24:23.000000000 +0100
  3. @@ -52,7 +52,7 @@ typedef struct {
  4. unsigned char *lfn_unicode = NULL;
  5. unsigned char lfn_checksum;
  6. int lfn_slot = -1;
  7. -loff_t *lfn_offsets = NULL;
  8. +off_t *lfn_offsets = NULL;
  9. int lfn_parts = 0;
  10. static unsigned char fat_uni2esc[64] = {
  11. @@ -170,7 +170,7 @@ static void clear_lfn_slots(int start, i
  12. }
  13. }
  14. -void lfn_fix_checksum(loff_t from, loff_t to, const char *short_name)
  15. +void lfn_fix_checksum(off_t from, off_t to, const char *short_name)
  16. {
  17. int i;
  18. __u8 sum;
  19. @@ -195,7 +195,7 @@ void lfn_reset(void)
  20. /* This function is only called with de->attr == VFAT_LN_ATTR. It stores part
  21. * of the long name. */
  22. -void lfn_add_slot(DIR_ENT * de, loff_t dir_offset)
  23. +void lfn_add_slot(DIR_ENT * de, off_t dir_offset)
  24. {
  25. LFN_ENT *lfn = (LFN_ENT *) de;
  26. int slot = lfn->id & LFN_ID_SLOTMASK;
  27. @@ -253,7 +253,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t d
  28. lfn_slot = slot;
  29. lfn_checksum = lfn->alias_checksum;
  30. lfn_unicode = alloc((lfn_slot * CHARS_PER_LFN + 1) * 2);
  31. - lfn_offsets = alloc(lfn_slot * sizeof(loff_t));
  32. + lfn_offsets = alloc(lfn_slot * sizeof(off_t));
  33. lfn_parts = 0;
  34. } else if (lfn_slot == -1 && slot != 0) {
  35. /* No LFN in progress, but slot found; start bit missing */
  36. @@ -272,7 +272,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t d
  37. switch (interactive ? get_key("123", "?") : '2') {
  38. case '1':
  39. if (!lfn_offsets)
  40. - lfn_offsets = alloc(sizeof(loff_t));
  41. + lfn_offsets = alloc(sizeof(off_t));
  42. lfn_offsets[0] = dir_offset;
  43. clear_lfn_slots(0, 0);
  44. lfn_reset();
  45. @@ -287,7 +287,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t d
  46. lfn_slot = slot;
  47. lfn_checksum = lfn->alias_checksum;
  48. lfn_unicode = alloc((lfn_slot * CHARS_PER_LFN + 1) * 2);
  49. - lfn_offsets = alloc(lfn_slot * sizeof(loff_t));
  50. + lfn_offsets = alloc(lfn_slot * sizeof(off_t));
  51. lfn_parts = 0;
  52. break;
  53. }
  54. @@ -319,7 +319,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t d
  55. switch (interactive ? get_key(can_fix ? "123" : "12", "?") : '2') {
  56. case '1':
  57. if (!lfn_offsets) {
  58. - lfn_offsets = alloc(sizeof(loff_t));
  59. + lfn_offsets = alloc(sizeof(off_t));
  60. lfn_parts = 0;
  61. }
  62. lfn_offsets[lfn_parts++] = dir_offset;
  63. @@ -406,7 +406,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t d
  64. /* This function is always called when de->attr != VFAT_LN_ATTR is found, to
  65. * retrieve the previously constructed LFN. */
  66. -char *lfn_get(DIR_ENT * de, loff_t * lfn_offset)
  67. +char *lfn_get(DIR_ENT * de, off_t * lfn_offset)
  68. {
  69. char *lfn;
  70. __u8 sum;