From 99d5a728798c1ada0e09be4489c77233bbad8011 Mon Sep 17 00:00:00 2001 From: ANTodorov Date: Thu, 21 Nov 2024 14:10:01 +0200 Subject: [PATCH] fixed symlink name in mem spiffs tree the used strtok(...,".")` is cutting the name to the first dot linkname.txt.lnk -> linkname with the fix it is linkname.txt.lnk -> linkname.txt --- CHANGELOG.md | 1 + armsrc/spiffs.c | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f83683b5fc..dc34cdcc2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- fixed symlink name in `mem spiffs tree` (@ANTodorov) - Updated atrs list (@iceman1001) - Added support for a new KDF (@iceman1001) - Added Inner range aid and mad entries (@iceman1001) diff --git a/armsrc/spiffs.c b/armsrc/spiffs.c index 9c5f96042f..b87696a5bb 100644 --- a/armsrc/spiffs.c +++ b/armsrc/spiffs.c @@ -651,8 +651,11 @@ void rdv40_spiffs_safe_print_tree(void) { read_from_spiffs((char *)pe->name, (uint8_t *)linkdest, SPIFFS_OBJ_NAME_LEN); sprintf(resolvedlink, "(.lnk) --> %s", linkdest); - // Kind of stripping the .lnk extension - strtok((char *)pe->name, "."); + char *linkname = (char *)pe->name; + int len = strlen(linkname); + if (len >= 4 && strcmp(&linkname[len - 4], ".lnk") == 0) { + linkname[len - 4] = '\0'; + } } Dbprintf("[%04x] " _YELLOW_("%5i") " B |-- %s%s", pe->obj_id, pe->size, pe->name, resolvedlink);