Skip to content

Commit

Permalink
adjust char replace
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Mar 9, 2023
1 parent e79840e commit 4062d76
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions Marlin/src/lcd/extui/mks_ui/wifi_module.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,12 @@ static bool longName2DosName(const char *longName, char *dosName) {
}

// Fail for illegal characters
PGM_P p = PSTR("|<>^+=?/[];,*\"\\");

while (uint8_t b = pgm_read_byte(p++)) {
if (b == c) {
c = ILLEGAL_CHAR_REPLACE; // replace illegal chars with underscore '_'
}
}

if (c < 0x21 || c == 0x7F) { // Check size, non-printable characters
if (c < 0x21 || c == 0x7F) // Check size, non-printable characters
c = ILLEGAL_CHAR_REPLACE; // replace non-printable chars with underscore '_'
else {
PGM_P p = PSTR("|<>^+=?/[];,*\"\\");
while (const uint8_t b = pgm_read_byte(p++))
if (b == c) c = ILLEGAL_CHAR_REPLACE; // replace illegal chars with underscore '_'
}

dosName[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); // Uppercase required for 8.3 name
Expand Down

0 comments on commit 4062d76

Please sign in to comment.