From b11f08931929e5f2f1fe8a3a2c0bd16d222b5625 Mon Sep 17 00:00:00 2001 From: Christopher Williams Date: Wed, 16 Aug 2023 17:35:03 -0700 Subject: [PATCH] R0.15 patch 3 August 15, 2023 f_setlabel function fails when set a volume label in Unix style volume ID. This problem was reported via an email. --- source/ff.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/ff.c b/source/ff.c index 492f48b..2091847 100644 --- a/source/ff.c +++ b/source/ff.c @@ -1,5 +1,5 @@ /*----------------------------------------------------------------------------/ -/ FatFs - Generic FAT Filesystem Module R0.15 w/patch2 / +/ FatFs - Generic FAT Filesystem Module R0.15 w/patch3 / /-----------------------------------------------------------------------------/ / / Copyright (C) 2022, ChaN, all right reserved. @@ -5462,6 +5462,10 @@ FRESULT f_setlabel ( /* Get logical drive */ res = mount_volume(&label, &fs, FA_WRITE); if (res != FR_OK) LEAVE_FF(fs, res); +#if FF_STR_VOLUME_ID == 2 + for ( ; *label == '/'; label++) ; /* Snip the separators off */ +#endif + #if FF_FS_EXFAT if (fs->fs_type == FS_EXFAT) { /* On the exFAT volume */