[PATCH] dosfs: Fix set of valid short name chars

sebastian.huber at embedded-brains.de sebastian.huber at embedded-brains.de
Mon Jun 18 11:50:44 UTC 2012


From: Sebastian Huber <sebastian.huber at embedded-brains.de>

The characters with code point values greater than 127 are valid short
and long name characters according to Microsoft (2000) “Microsoft
Extensible Firmware Initiative, FAT32 File System Specification, FAT:
General Overview of On-Disk Format” Hardware White Paper.
---
 cpukit/libfs/src/dosfs/msdos_misc.c  |    2 +-
 testsuites/fstests/fspatheval/test.c |   12 ++++++------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index ed791ee..981f8e2 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -64,7 +64,7 @@ msdos_is_valid_name_char(const char ch)
         return MSDOS_NAME_LONG;
 
     if ((ch == '.') || isalnum((unsigned char)ch) ||
-        (strchr("$%'-_@~`!(){}^#&", ch) != NULL))
+        (strchr("$%'-_@~`!(){}^#&", ch) != NULL) || (unsigned char) ch > 127)
         return MSDOS_NAME_SHORT;
 
     return MSDOS_NAME_INVALID;
diff --git a/testsuites/fstests/fspatheval/test.c b/testsuites/fstests/fspatheval/test.c
index ad69b7e..0e89eb0 100644
--- a/testsuites/fstests/fspatheval/test.c
+++ b/testsuites/fstests/fspatheval/test.c
@@ -85,8 +85,8 @@ static void path_eval_test01 (void)
 {
   char *valid_path[] = {
     "/test1/",
-    "tets2",
-    "///test3",
+    "测试2",
+    "///тест3",
     "test4////",
     "../../test5",
     "/test1/../test6",
@@ -98,8 +98,8 @@ static void path_eval_test01 (void)
   };
   char *valid_file[]={
     "/test1",
-    "tets2",
-    "///test3",
+    "测试2",
+    "///тест3",
     "test4",
     "../../test5",
     "/../test6",
@@ -112,8 +112,8 @@ static void path_eval_test01 (void)
 
   char *valid_relative_path[]={
     "test1",
-    "tets2",
-    "test3",
+    "测试2",
+    "тест3",
     "test4",
     "test5",
     "test6",
-- 
1.6.4.2




More information about the devel mailing list