Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed symlink name in mem spiffs tree
Browse files Browse the repository at this point in the history
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
ANTodorov committed Nov 21, 2024

Verified

This commit was signed with the committer’s verified signature.
ANTodorov Anton Todorov
1 parent 9f4a028 commit fbc3797
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions armsrc/spiffs.c
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit fbc3797

Please sign in to comment.