Merge pull request #3648 from Blue-Marlin/83filenames

Don't reject 8.3-filenames with chars > 0x7f
This commit is contained in:
Scott Lahteine 2016-04-30 17:48:03 -07:00
commit 77d6e5283b

View file

@ -405,7 +405,7 @@ bool SdBaseFile::make83Name(const char* str, uint8_t* name, const char** ptr) {
uint8_t b; uint8_t b;
while ((b = pgm_read_byte(p++))) if (b == c) goto fail; while ((b = pgm_read_byte(p++))) if (b == c) goto fail;
// check size and only allow ASCII printable characters // check size and only allow ASCII printable characters
if (i > n || c < 0X21 || c > 0X7E)goto fail; if (i > n || c < 0X21 || c == 0X7E)goto fail;
// only upper case allowed in 8.3 names - convert lower to upper // only upper case allowed in 8.3 names - convert lower to upper
name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a')); name[i++] = (c < 'a' || c > 'z') ? (c) : (c + ('A' - 'a'));
} }