From f213afacbe7122606e42ec40d7f4648964b5887c Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Wed, 16 Feb 2005 21:56:20 +0000 Subject: For shortname creation, replace most illegal characters by underscores instead of removing them, thereby lowering the chance to create a blank (illegal) name. Spaces and control chars are still removed. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@5991 a1c6a512-1295-4272-9138-f99709370657 --- firmware/drivers/fat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'firmware') diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c index b3da25cc4d..65c6a3152e 100644 --- a/firmware/drivers/fat.c +++ b/firmware/drivers/fat.c @@ -1432,7 +1432,7 @@ unsigned char char2dos(unsigned char c) case 0xe5: /* Special kanji character */ c = 0x05; break; - case 0x20: + case 0x22: case 0x2a: case 0x2b: @@ -1448,14 +1448,14 @@ unsigned char char2dos(unsigned char c) case 0x5c: case 0x5d: case 0x7c: - /* Illegal name */ - c = 0; + /* Illegal name, replace */ + c = '_'; break; default: - if(c < 0x20) + if(c <= 0x20) { - /* Illegal name */ + /* Illegal name, remove */ c = 0; } break; -- cgit v1.2.3