home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sources / bugs / 226 < prev    next >
Encoding:
Text File  |  1992-09-08  |  5.8 KB  |  222 lines

  1. Newsgroups: comp.sources.bugs
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!sdd.hp.com!ux1.cso.uiuc.edu!news.cso.uiuc.edu!osiris.cso.uiuc.edu!egray
  3. From: egray@osiris.cso.uiuc.edu (Emmet P. Gray)
  4. Subject: Patch #7 to Mtools v2.0
  5. Message-ID: <Bu64t9.Iqs@news.cso.uiuc.edu>
  6. Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
  7. Organization: US Army Corps of Engineers - Construction Eng Research Lab
  8. Date: Sun, 6 Sep 1992 18:03:08 GMT
  9. Lines: 211
  10.  
  11.  
  12. This is patch #7 to the Mtools v2.0 distribution package.  This patch
  13. will change the method of determining if the FAT encoding scheme in the
  14. devices.c file is correct.  The method introduced by patch #6 was naive
  15. and easily fooled.
  16.  
  17. A pre-processor variable called CHK_FAT has been added to the fat_read.c
  18. file just in case this new method isn't appropriate for all disks.
  19.  
  20. Mtools v2.0.5 was posted to the comp.sources.unix news group the 2nd
  21. week of January 92 as v25i097 thru v25i099.  Patch #6 was posted to
  22. comp.sources.bugs on 21 Aug.
  23.  
  24. Emmet P. Gray                US Army, HQ III Corps & Fort Hood
  25. ...!uunet!uiucuxc!fthood!egray        Attn: AFZF-DE-ENV
  26. fthood!egray@uxc.cso.uiuc.edu        Directorate of Engineering & Housing
  27.                     Environmental Management Office
  28.                     Fort Hood, TX 76544-5057
  29.  
  30. -----------------------------------------------------------------------------
  31. Prereq: "2.0.6"
  32. *** old/patchlevel.h    Sat Aug 22 21:54:38 1992
  33. --- patchlevel.h    Sun Sep  6 10:49:30 1992
  34. ***************
  35. *** 1,19 ****
  36. ! #define VERSION    "2.0.6"
  37. ! #define DATE    "21 Aug 92"
  38. ! /*
  39. !  * Version 1.0        13 Oct 86
  40. !  * Version 1.1        11 Jan 87
  41. !  * Version 1.2        11 Jun 87
  42. !  * Version 1.3        15 Jun 88
  43. !  * Version 1.4        28 Sep 88
  44. !  * Version 1.5         9 Oct 88
  45. !  * Version 1.6         3 May 89
  46. !  * Version 2.0         8 Sep 90
  47. !  *  patch #1        12 Oct 90
  48. !  *  patch #2        21 Nov 90
  49. !  *  patch #3        28 Nov 90
  50. !  *  patch #4        11 Apr 91
  51. !  *  patch #5        25 Aug 91
  52. !  *  patch #6        21 Aug 92
  53. !  */
  54. --- 1,2 ----
  55. ! #define VERSION    "2.0.7"
  56. ! #define DATE    "6 Sep 92"
  57. *** old/Configure    Sat Aug 22 21:54:35 1992
  58. --- Configure    Sun Sep  6 10:52:40 1992
  59. ***************
  60. *** 63,66 ****
  61. --- 63,69 ----
  62.       configured to the "base" return type of signal();
  63.   
  64. +     The fat_read.c file has a preprocessor variable "CHK_FAT" that
  65. +     can be undefined to turn off the fat encoding check if needed.
  66.   3) The devices "database" in devices.c
  67.   
  68. *** old/Mtools.1    Sat Aug 22 21:54:37 1992
  69. --- Mtools.1    Mon Aug 31 18:36:44 1992
  70. ***************
  71. *** 35,38 ****
  72. --- 35,59 ----
  73.   pattern matching.
  74.   .PP
  75. + Not all Unix filenames are appropriate in the MSDOS world.  The Mtools
  76. + commands may have to alter Unix names to fit the MSDOS filename
  77. + restrictions.  Most commands have a -v (verbose) option that will
  78. + display the new names if they have been changed.  The following table
  79. + shows some examples of filename conversions:
  80. + .PP
  81. + .in +0.5i
  82. + .(b L
  83. + .TS
  84. + l l l.
  85. + Unix name    MSDOS name    Reason for the change
  86. + _    _    _
  87. + thisisatest    THISISAT    filename too long
  88. + emmet.gray    EMMET.GRA    extension too long
  89. + prn.txt    XRN.TXT    PRN is a device name
  90. + \.abc    X.ABC    null filename
  91. + hot+cold    HOTXCOLD    illegal character
  92. + .TE
  93. + .)b
  94. + .in
  95. + .PP
  96.   All options use the '-' (minus) flag, not '/' as you'd expect in MSDOS.
  97.   .PP
  98. *** old/Release.notes    Sat Aug 22 21:54:37 1992
  99. --- Release.notes    Sun Sep  6 10:50:03 1992
  100. ***************
  101. *** 1,2 ****
  102. --- 1,12 ----
  103. + Patch #7, 6 Sep 92
  104. + This patch will change the method of determining if the FAT encoding
  105. + scheme in the devices.c file is correct.  The method introduced by patch
  106. + #6 was naive and easily fooled.
  107. + A pre-processor variable called CHK_FAT has been added to the fat_read.c
  108. + file just in case this new method isn't appropriate for all disks.
  109. + -----------------------------------------------------------------------------
  110.   Patch #6, 21 Aug 92
  111.   
  112. *** old/devices.c    Sat Aug 22 21:54:37 1992
  113. --- devices.c    Fri Aug 28 08:32:18 1992
  114. ***************
  115. *** 63,67 ****
  116.       }
  117.   
  118. !     gdbuf.params.cyls = ntracks * nheads;
  119.       gdbuf.params.heads = nheads;
  120.       gdbuf.params.psectrk = nsect;
  121. --- 63,67 ----
  122.       }
  123.   
  124. !     gdbuf.params.cyls = ntracks;
  125.       gdbuf.params.heads = nheads;
  126.       gdbuf.params.psectrk = nsect;
  127. ***************
  128. *** 133,138 ****
  129.       }
  130.   
  131. !     if (ntracks && nheads)
  132. !         dkbuf.ncyl = ntracks * nheads;
  133.       if (nheads)
  134.           dkbuf.nhead = nheads;
  135. --- 133,138 ----
  136.       }
  137.   
  138. !     if (ntracks)
  139. !         dkbuf.ncyl = ntracks;
  140.       if (nheads)
  141.           dkbuf.nhead = nheads;
  142. *** old/fat_read.c    Sat Aug 22 21:54:37 1992
  143. --- fat_read.c    Mon Aug 31 18:02:37 1992
  144. ***************
  145. *** 2,5 ****
  146. --- 2,7 ----
  147.   #include "msdos.h"
  148.   
  149. + #define CHK_FAT
  150.   int fat_len;                /* length of FAT table (in sectors) */
  151.   unsigned int end_fat;            /* the end-of-chain marker */
  152. ***************
  153. *** 8,11 ****
  154. --- 10,14 ----
  155.   
  156.   extern int fat_bits;
  157. + extern unsigned num_clus;
  158.   
  159.   /*
  160. ***************
  161. *** 77,81 ****
  162.   int start;
  163.   {
  164. !     int i;
  165.       unsigned int buflen;
  166.       char *malloc();
  167. --- 80,84 ----
  168.   int start;
  169.   {
  170. !     int i, fat_size;
  171.       unsigned int buflen;
  172.       char *malloc();
  173. ***************
  174. *** 91,94 ****
  175. --- 94,110 ----
  176.       }
  177.   #endif /* INT16 */
  178. +     /*
  179. +      * Let's see if the length of the FAT table is appropriate for
  180. +      * the number of clusters and the encoding scheme
  181. +      */
  182. + #ifdef CHK_FAT
  183. +     fat_size = (fat_bits == 12) ? (num_clus +2) * 3 / 2 : (num_clus +2) * 2;
  184. +     fat_size = (fat_size / 512) + ((fat_size % 512) ? 1 : 0);
  185. +     if (fat_size != fat_len) {
  186. +         fprintf(stderr, "fat_read: Wrong FAT encoding?\n");
  187. +         exit(1);
  188. +     }
  189. + #endif /* CHK_FAT */
  190.                       /* only the first copy of the FAT */
  191.       buflen = fat_len * MSECTOR_SIZE;
  192. ***************
  193. *** 106,113 ****
  194.           end_fat = 0xfff;
  195.           last_fat = 0xff8;
  196. -         if (fat_buf[3] == 0xff) {
  197. -             fprintf(stderr, "fat_read: wrong FAT encoding\n");
  198. -             exit(1);
  199. -         }
  200.       }
  201.       else {
  202. --- 122,125 ----
  203. ***************
  204. *** 114,121 ****
  205.           end_fat = 0xffff;
  206.           last_fat = 0xfff8;
  207. -         if (fat_buf[3] != 0xff) {
  208. -             fprintf(stderr, "fat_read: wrong FAT encoding\n");
  209. -             exit(1);
  210. -         }
  211.       }
  212.       return;
  213. --- 126,129 ----
  214. End of Patch
  215.