use longest_filename() for SD card files instead of longFilename
The long filename is not always filled, so files like "test.gco" may not be shown in the file list. Use the built-in fallback to the longest name available to overcome that issue and print the 8.3 name if no other is available.
This commit is contained in:
@@ -1190,7 +1190,9 @@
|
|||||||
else {
|
else {
|
||||||
card.selectFileByIndex(count - 1);
|
card.selectFileByIndex(count - 1);
|
||||||
|
|
||||||
int fileNameLen = strlen(card.longFilename);
|
// THe longname may not be filed, so we use the built-in fallback here.
|
||||||
|
char* fileName = card.longest_filename();
|
||||||
|
int fileNameLen = strlen(fileName);
|
||||||
bool fileNameWasCut = false;
|
bool fileNameWasCut = false;
|
||||||
|
|
||||||
// Cut off too long filenames.
|
// Cut off too long filenames.
|
||||||
@@ -1211,7 +1213,7 @@
|
|||||||
outputString[i] = ' ';
|
outputString[i] = ' ';
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
outputString[i] = card.longFilename[i];
|
outputString[i] = fileName[i];
|
||||||
if (!isPrintable(outputString[i]))
|
if (!isPrintable(outputString[i]))
|
||||||
outputString[i] = '_';
|
outputString[i] = '_';
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user