forked from len0rd/rockbox
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
This commit is contained in:
parent
3eb45f9313
commit
f213afacbe
1 changed files with 5 additions and 5 deletions
|
@ -1432,7 +1432,7 @@ unsigned char char2dos(unsigned char c)
|
||||||
case 0xe5: /* Special kanji character */
|
case 0xe5: /* Special kanji character */
|
||||||
c = 0x05;
|
c = 0x05;
|
||||||
break;
|
break;
|
||||||
case 0x20:
|
|
||||||
case 0x22:
|
case 0x22:
|
||||||
case 0x2a:
|
case 0x2a:
|
||||||
case 0x2b:
|
case 0x2b:
|
||||||
|
@ -1448,14 +1448,14 @@ unsigned char char2dos(unsigned char c)
|
||||||
case 0x5c:
|
case 0x5c:
|
||||||
case 0x5d:
|
case 0x5d:
|
||||||
case 0x7c:
|
case 0x7c:
|
||||||
/* Illegal name */
|
/* Illegal name, replace */
|
||||||
c = 0;
|
c = '_';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(c < 0x20)
|
if(c <= 0x20)
|
||||||
{
|
{
|
||||||
/* Illegal name */
|
/* Illegal name, remove */
|
||||||
c = 0;
|
c = 0;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue