[rtems commit] dosfs: Fix long file name padding

Sebastian Huber sebh at rtems.org
Thu Mar 16 14:36:04 UTC 2017


Module:    rtems
Branch:    master
Commit:    5f8ed0d8dad90858018a63a324588724c3506caa
Changeset: http://git.rtems.org/rtems/commit/?id=5f8ed0d8dad90858018a63a324588724c3506caa

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar 16 07:44:38 2017 +0100

dosfs: Fix long file name padding

Update #2934.

---

 cpukit/libfs/src/dosfs/msdos_misc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/libfs/src/dosfs/msdos_misc.c b/cpukit/libfs/src/dosfs/msdos_misc.c
index 09029e7..0323c55 100644
--- a/cpukit/libfs/src/dosfs/msdos_misc.c
+++ b/cpukit/libfs/src/dosfs/msdos_misc.c
@@ -1760,10 +1760,11 @@ msdos_add_file (
 #endif
         for (i = 0; i < MSDOS_LFN_LEN_PER_ENTRY; ++i)
         {
-            if (!(*n == 0 && *(n+1) == 0))
+            if (*n != 0 || *(n + 1) != 0)
             {
                 *p = *n;
-                *(p+1) = *(n+1);
+                *(p + 1) = *(n + 1);
+                n += MSDOS_NAME_LFN_BYTES_PER_CHAR;
             }
             else
             {
@@ -1771,7 +1772,6 @@ msdos_add_file (
                 p [1] = fill;
                 fill = 0xff;
             }
-            n += MSDOS_NAME_LFN_BYTES_PER_CHAR;
 #if MSDOS_FIND_PRINT
             printf ( "'%c''%c'", *p, *(p+1) );
 #endif



More information about the vc mailing list