From a7084509b51e8c39d4018144b38b5b6a4b5242f8 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Wed, 17 Mar 2021 20:45:36 +0100 Subject: [PATCH] fix(fs): do not trim the leading / from the path --- src/misc/lv_fs.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/misc/lv_fs.c b/src/misc/lv_fs.c index a6b57f42a..f78b426e6 100644 --- a/src/misc/lv_fs.c +++ b/src/misc/lv_fs.c @@ -368,25 +368,14 @@ const char * lv_fs_get_last(const char * path) **********************/ /** - * Leave the driver letters and / or \ letters from beginning of the path + * Skip the driver letter and the possible : after the letter * @param path path string (E.g. S:/folder/file.txt) - * @return pointer to the beginning of the real path (E.g. folder/file.txt) + * @return pointer to the beginning of the real path (E.g. /folder/file.txt) */ static const char * lv_fs_get_real_path(const char * path) { - /* Example path: "S:/folder/file.txt" - * Leave the letter and the : / \ characters*/ - path++; /*Ignore the driver letter*/ - - while(*path != '\0') { - if(*path == ':' || *path == '\\' || *path == '/') { - path++; - } - else { - break; - } - } + if(*path == ':') path++; return path; }