Skip to content

Commit f387824

Browse files
authored
Update littlefs to v2.11.2 (#3270)
1 parent bc0e317 commit f387824

11 files changed

Lines changed: 36 additions & 19 deletions

File tree

.devcontainer/All/Dockerfile.All

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/nanoframework/dev-container-all:v2.59
1+
FROM ghcr.io/nanoframework/dev-container-all:v2.60

.devcontainer/All/Dockerfile.All.SRC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ RUN git clone --branch v6.5.0.202601_rel --recursive https://github.com/eclipse-
103103

104104
# Clone dependent repos (mbedtls, fatfs and littlefs)
105105
RUN git clone --branch R0.15a https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
106-
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
106+
&& git clone --branch v2.11.2 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
107107
&& git clone --branch mbedtls-3.6.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
108108
&& cd ./sources/mbedtls \
109109
&& git submodule update --init --recursive

.devcontainer/All/scripts/git-pull-repos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ git pull origin 5.5.1
2727
cd /sources/lwip
2828
git pull origin STABLE-2_1_3_RELEASE
2929
cd /sources/littlefs
30-
git pull origin v2.9.3
30+
git pull origin v2.11.2
3131
cd /sources/SimpleLinkCC32
3232
git pull origin 4.10.00.07
3333
cd /sources/SimpleLinkCC13
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/nanoframework/dev-container-chibios:v1.36
1+
FROM ghcr.io/nanoframework/dev-container-chibios:v1.37

.devcontainer/ChibiOS/Dockerfile.ChibiOS.SRC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ RUN git clone --branch nf-build https://github.com/nanoframework/STM32CubeL4.git
6666

6767
# Clone dependent repos (mbedtls, fatfs and littlefs etc.)
6868
RUN git clone --branch R0.15a https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
69-
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
69+
&& git clone --branch v2.11.2 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
7070
&& git clone --branch STABLE-2_1_3_RELEASE https://github.com/lwip-tcpip/lwip.git --depth 1 ./sources/lwip \
7171
&& git clone --branch mbedtls-3.6.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
7272
&& cd ./sources/mbedtls \
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
FROM ghcr.io/nanoframework/dev-container-threadx:v1.36
1+
FROM ghcr.io/nanoframework/dev-container-threadx:v1.37

.devcontainer/ThreadX/Dockerfile.ThreadX.SRC

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ RUN git clone --branch v6.5.0.202601_rel --recursive https://github.com/eclipse-
6868

6969
# Clone dependent repos (mbedtls, fatfs and littlefs)
7070
RUN git clone --branch R0.15a https://github.com/abbrev/fatfs.git --depth 1 ./sources/fatfs \
71-
&& git clone --branch v2.9.3 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
71+
&& git clone --branch v2.11.2 https://github.com/littlefs-project/littlefs --depth 1 ./sources/littlefs \
7272
&& git clone --branch mbedtls-3.6.5 https://github.com/ARMmbed/mbedtls.git --depth 1 ./sources/mbedtls \
7373
&& cd ./sources/mbedtls \
7474
&& git submodule update --init --recursive

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ resources:
5353
type: github
5454
name: littlefs-project/littlefs
5555
endpoint: nanoframework
56-
ref: refs/tags/v2.9.3
56+
ref: refs/tags/v2.11.2
5757

5858
jobs:
5959
##############################

targets/ChibiOS/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ if(NF_FEATURE_USE_LITTLEFS_OPTION)
357357
if(LITTLEFS_VERSION_EMPTY)
358358
# no littlefs version actualy specified, must be empty which is fine, we'll default to a known good version
359359
# WHEN CHANGING THIS MAKE SURE TO UPDATE THE DEV CONTAINERS AND PIPELINE YAML
360-
set(LITTLEFS_VERSION_TAG "v2.9.3")
360+
set(LITTLEFS_VERSION_TAG "v2.11.2")
361361
else()
362362
# set version
363363
set(LITTLEFS_VERSION_TAG ${LITTLEFS_VERSION})

targets/ChibiOS/_littlefs/littlefs_FS_Driver.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,8 @@ static int NormalizePath(const char *path, char *buffer, size_t bufferSize)
11601160
*bufferP = '\0';
11611161

11621162
// remove trailing slash, if any
1163-
if (bufferP[-1] == '/')
1163+
// guard against undefined behavior: only check bufferP[-1] when buffer is non-empty
1164+
if (bufferP > buffer && bufferP[-1] == '/')
11641165
{
11651166
bufferP--;
11661167
*bufferP = '\0';
@@ -1172,6 +1173,13 @@ static int NormalizePath(const char *path, char *buffer, size_t bufferSize)
11721173
memmove(buffer, buffer + 1, hal_strlen_s(buffer));
11731174
}
11741175

1176+
// use "/" instead to reference the root
1177+
if (buffer[0] == '\0')
1178+
{
1179+
buffer[0] = '/';
1180+
buffer[1] = '\0';
1181+
}
1182+
11751183
return 0;
11761184
}
11771185

0 commit comments

Comments
 (0)