diff --git a/ChangeLog b/ChangeLog index c3480dfb3..251dfd564 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ * parser.c: (parse_job, parser_skip_arguemnts, paresr_Test): No semicolon required after else and begin + * input_common.c (readb): Fix sign error + + * input.c (input_expand_sequence): Add support for numeric backslash escapes + 2005-09-24 Axel Liljencrantz diff --git a/doc_src/doc.hdr b/doc_src/doc.hdr index 9e9956315..3c173d06a 100644 --- a/doc_src/doc.hdr +++ b/doc_src/doc.hdr @@ -884,8 +884,6 @@ g++, javac, java, gcj, lpr, doxygen, whois, find) version of a POSIX command - Yanking weird characters from clipboard prints Unicode escapes - Prefix string in completion display is sometimes incorrect -- Pressing escape when doing a token search breaks things -- Universal variables should be exportable If you think you have found a bug not described here, please send a report to axel@liljencrantz.se diff --git a/input.c b/input.c index b6dd48427..9a11b0aa9 100644 --- a/input.c +++ b/input.c @@ -361,6 +361,7 @@ repaint();*/ */ static wchar_t *input_expand_sequence( const wchar_t *in ) { + const wchar_t *in_orig=in; wchar_t *res = malloc( sizeof( wchar_t)*(4*wcslen(in)+1)); wchar_t *out=res; int error = 0; @@ -372,13 +373,12 @@ static wchar_t *input_expand_sequence( const wchar_t *in ) case L'\\': { in++; -// fwprintf( stderr, L"Backslash\n" ); switch( *in ) { case L'\0': error = 1; break; - + case L'e': *(out++)=L'\e'; break; @@ -427,15 +427,77 @@ static wchar_t *input_expand_sequence( const wchar_t *in ) case L'v': *(out++)=L'\v'; break; + + /* + Parse numeric backslash escape + */ + case L'u': + case L'U': + case L'x': + case L'o': + { + int i; + wchar_t res=0; + int chars=2; + int base=16; + + switch( *in++ ) + { + case L'u': + base=16; + chars=4; + break; + + case L'U': + base=16; + chars=8; + break; + + case L'x': + base=16; + chars=2; + break; + + case L'o': + base=8; + chars=3; + break; + + } + wchar_t *ggg = in; + + for( i=0; iseq[j] != L'\0' && m->seq[j] == (c=input_common_readch( j>0 )); j++ ) ; + if( m->seq[j] == L'\0' ) { - return input_exec_binding( m, m->seq ); } else @@ -1200,10 +1273,10 @@ wint_t input_readch() if( wcslen( m->seq) == 0 ) { wchar_t arr[2]= - { - 0, - 0 - } + { + 0, + 0 + } ; arr[0] = input_common_readch(0); diff --git a/input_common.c b/input_common.c index 920fbbf43..55d9580ce 100644 --- a/input_common.c +++ b/input_common.c @@ -56,7 +56,7 @@ void input_common_destroy() */ static wint_t readb() { - char arr[1]; + unsigned char arr[1]; int do_loop = 0; do