Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37517827
en ru br
ALT Linux repos
S:4.2-alt2
5.0: 2.11-alt5
4.1: 2.11-alt4
4.0: 2.11-alt4
3.0: 2.11-alt3

Group :: File tools
RPM: dosfstools

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: dosfstools-2.11-alt-fsck866.patch
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;
     }
 
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin