Use private use area for internal non-unicode characters

darcs-hash:20051020112754-ac50b-a640e5eb3c72c44671bfd5d0e4d6805018da5b48.gz
This commit is contained in:
axel
2005-10-20 21:27:54 +10:00
parent 83fcc29305
commit ce27f08a44
4 changed files with 55 additions and 32 deletions

View File

@@ -2392,7 +2392,14 @@ static int can_read( int fd )
return 0;
}
/**
Test if the specified character is in the private use area that fish uses to store internal characters
*/
static int wchar_private( wchar_t c )
{
return ( (c >= 0xe000) && (c <= 0xf8ff ) );
}
wchar_t *reader_readline()
{
@@ -2442,7 +2449,7 @@ wchar_t *reader_readline()
while( 1 )
{
c=input_readch();
if( (c< WCHAR_END) && (c>31) && (c != 127) )
if( ( (!wchar_private(c))) && (c>31) && (c != 127) )
{
if( can_read(0) )
{
@@ -2462,7 +2469,7 @@ wchar_t *reader_readline()
break;
}
c = input_readch();
if( (c< WCHAR_END) && (c>31) && (c != 127) )
if( (!wchar_private(c)) && (c>31) && (c != 127) )
{
arr[i]=c;
c=0;
@@ -2835,7 +2842,7 @@ wchar_t *reader_readline()
/* Other, if a normal character, we add it to the command */
default:
{
if( (c< WCHAR_END) && (c>31) && (c != 127) )
if( (!wchar_private(c)) && (c>31) && (c != 127) )
insert_char( c );
else
debug( 0, L"Unknown keybinding %d", c );