Group :: File tools
RPM: dosfstools
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: dosfstools-2.11-alt-fsck866.patch
Download
Download
--- dosfstools-2.11/dosfsck/check.c.orig 2005-03-12 18:08:43 +0300
+++ dosfstools-2.11/dosfsck/check.c 2007-01-04 12:57:22 +0300
@@ -217,6 +217,16 @@ static char *file_stat(DOS_FILE *file)
}
+static int is_suspicious(unsigned char c)
+{
+ if (c >= 0x80 && c < 0xB0)
+ return 0; /* CP866 A6B..on */
+ if (c >= 0xE0 && c < 0xF2)
+ return 0; /* CP866 pcmy..Ee */
+ return (c > 0x7f);
+}
+
+
static int bad_name(unsigned char *name)
{
int i, spc, suspicious = 0;
@@ -229,13 +239,13 @@ static int bad_name(unsigned char *name)
for (i = 0; i < 8; i++) {
if (name[i] < ' ' || name[i] == 0x7f) return 1;
- if (name[i] > 0x7f) ++suspicious;
+ suspicious += is_suspicious(name[i]);
if (strchr(bad_chars,name[i])) return 1;
}
for (i = 8; i < 11; i++) {
if (name[i] < ' ' || name[i] == 0x7f) return 1;
- if (name[i] > 0x7f) ++suspicious;
+ suspicious += is_suspicious(name[i]);
if (strchr(bad_chars,name[i])) return 1;
}