summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/oofatfs/ff.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/oofatfs/ff.c b/lib/oofatfs/ff.c
index 0c9d04fe7..eca5b45bd 100644
--- a/lib/oofatfs/ff.c
+++ b/lib/oofatfs/ff.c
@@ -2821,7 +2821,7 @@ static FRESULT create_name ( /* FR_OK: successful, FR_INVALID_NAME: could not
if (di >= FF_MAX_LFN) return FR_INVALID_NAME; /* Reject too long name */
lfn[di++] = wc; /* Store the Unicode character */
}
- while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */
+ if (wc == '/' || wc == '\\') while (*p == '/' || *p == '\\') p++; /* Skip duplicated separators if exist */
*path = p; /* Return pointer to the next segment */
cf = (wc < ' ') ? NS_LAST : 0; /* Set last segment flag if end of the path */