From ef202f6b0e41caa67d4574f925cbdeb59c623493 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 23 Aug 2012 12:00:26 +0000 Subject: Fixed bug 3560980. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@4617 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARM7-AT91SAM7X-FATFS-GCC/main.c | 6 +++++- demos/ARM7-LPC214x-FATFS-GCC/main.c | 6 +++++- demos/ARMCM3-STM32F103-FATFS/main.c | 6 +++++- demos/ARMCM3-STM32F103ZG-FATFS/main.c | 6 +++++- demos/ARMCM3-STM32F107-FATFS/main.c | 6 +++++- demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c | 6 +++++- readme.txt | 2 ++ 7 files changed, 32 insertions(+), 6 deletions(-) diff --git a/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c b/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c index c1b5c5a1d..01588c3c1 100644 --- a/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c +++ b/demos/ARM7-AT91SAM7X-FATFS-GCC/main.c @@ -155,6 +155,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { int i; char *fn; +#if _USE_LFN + fno.lfname = 0; + fno.lfsize = 0; +#endif res = f_opendir(&dir, path); if (res == FR_OK) { i = strlen(path); @@ -171,7 +175,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { res = scan_files(chp, path); if (res != FR_OK) break; - path[i] = 0; + path[--i] = 0; } else { chprintf(chp, "%s/%s\r\n", path, fn); diff --git a/demos/ARM7-LPC214x-FATFS-GCC/main.c b/demos/ARM7-LPC214x-FATFS-GCC/main.c index 313ce7c2f..49ea78e6c 100644 --- a/demos/ARM7-LPC214x-FATFS-GCC/main.c +++ b/demos/ARM7-LPC214x-FATFS-GCC/main.c @@ -154,6 +154,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { int i; char *fn; +#if _USE_LFN + fno.lfname = 0; + fno.lfsize = 0; +#endif res = f_opendir(&dir, path); if (res == FR_OK) { i = strlen(path); @@ -170,7 +174,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { res = scan_files(chp, path); if (res != FR_OK) break; - path[i] = 0; + path[--i] = 0; } else { chprintf(chp, "%s/%s\r\n", path, fn); diff --git a/demos/ARMCM3-STM32F103-FATFS/main.c b/demos/ARMCM3-STM32F103-FATFS/main.c index ce5026a95..42c83435e 100644 --- a/demos/ARMCM3-STM32F103-FATFS/main.c +++ b/demos/ARMCM3-STM32F103-FATFS/main.c @@ -143,6 +143,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { int i; char *fn; +#if _USE_LFN + fno.lfname = 0; + fno.lfsize = 0; +#endif res = f_opendir(&dir, path); if (res == FR_OK) { i = strlen(path); @@ -159,7 +163,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { res = scan_files(chp, path); if (res != FR_OK) break; - path[i] = 0; + path[--i] = 0; } else { chprintf(chp, "%s/%s\r\n", path, fn); diff --git a/demos/ARMCM3-STM32F103ZG-FATFS/main.c b/demos/ARMCM3-STM32F103ZG-FATFS/main.c index fe85ac1aa..28bd21d3a 100644 --- a/demos/ARMCM3-STM32F103ZG-FATFS/main.c +++ b/demos/ARMCM3-STM32F103ZG-FATFS/main.c @@ -121,6 +121,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { int i; char *fn; +#if _USE_LFN + fno.lfname = 0; + fno.lfsize = 0; +#endif res = f_opendir(&dir, path); if (res == FR_OK) { i = strlen(path); @@ -137,7 +141,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { res = scan_files(chp, path); if (res != FR_OK) break; - path[i] = 0; + path[--i] = 0; } else { chprintf(chp, "%s/%s\r\n", path, fn); diff --git a/demos/ARMCM3-STM32F107-FATFS/main.c b/demos/ARMCM3-STM32F107-FATFS/main.c index fd49241cd..9c6e03f5b 100644 --- a/demos/ARMCM3-STM32F107-FATFS/main.c +++ b/demos/ARMCM3-STM32F107-FATFS/main.c @@ -135,6 +135,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { int i; char *fn; +#if _USE_LFN + fno.lfname = 0; + fno.lfsize = 0; +#endif res = f_opendir(&dir, path); if (res == FR_OK) { i = strlen(path); @@ -151,7 +155,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { res = scan_files(chp, path); if (res != FR_OK) break; - path[i] = 0; + path[--i] = 0; } else { chprintf(chp, "%s/%s\r\n", path, fn); diff --git a/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c b/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c index e22710174..09a6ae3a6 100644 --- a/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c +++ b/demos/ARMCM4-STM32F407-LWIP-FATFS-USB/main.c @@ -125,6 +125,10 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { int i; char *fn; +#if _USE_LFN + fno.lfname = 0; + fno.lfsize = 0; +#endif res = f_opendir(&dir, path); if (res == FR_OK) { i = strlen(path); @@ -141,7 +145,7 @@ static FRESULT scan_files(BaseSequentialStream *chp, char *path) { res = scan_files(chp, path); if (res != FR_OK) break; - path[i] = 0; + path[--i] = 0; } else { chprintf(chp, "%s/%s\r\n", path, fn); diff --git a/readme.txt b/readme.txt index b1a0eb792..92f9faeae 100644 --- a/readme.txt +++ b/readme.txt @@ -82,6 +82,8 @@ ***************************************************************************** *** 2.5.0 *** +- FIX: Fixed Problem in FatFs demos related to LFN (bug 3560980)(backported + to 2.4.3 and 2.2.10). - FIX: Fixed problem in STM32 DMA1 stream1 IRQ handler (bug 3538468) (backported to 2.4.2). - FIX: Fixed TIM8 not working in STM32 GPT driver (bug 3536523)( -- cgit v1.2.3