From 36ae253a2991bcc3835316ca730d77e3f659af36 Mon Sep 17 00:00:00 2001 From: axel Date: Thu, 15 Jun 2006 20:36:46 +1000 Subject: Minor comment edits, reindentation and other code formating changes darcs-hash:20060615103646-ac50b-d7cde4cfca0c776127e9e161daefb74ee6d027ba.gz --- common.c | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) (limited to 'common.c') diff --git a/common.c b/common.c index 69dccb78..c7a728f9 100644 --- a/common.c +++ b/common.c @@ -131,12 +131,6 @@ int fgetws2( wchar_t **b, int *len, FILE *f ) wchar_t *buff = *b; - /* - This is a kludge: We block SIGCHLD while reading, since I can't - get getwc to perform reliably when signals are flying. Even when - watching for EINTR errors, bytes are lost. - */ - while( 1 ) { /* Reallocate the buffer if necessary */ @@ -242,12 +236,12 @@ wchar_t *str2wcs_internal( const char *in, wchar_t *out ) { case (size_t)(-2): case (size_t)(-1): - { - out[out_pos] = ENCODE_DIRECT_BASE + (unsigned char)in[in_pos]; - in_pos++; - memset( &state, 0, sizeof(state) ); - break; - } + { + out[out_pos] = ENCODE_DIRECT_BASE + (unsigned char)in[in_pos]; + in_pos++; + memset( &state, 0, sizeof(state) ); + break; + } case 0: { @@ -660,8 +654,10 @@ void write_screen( const wchar_t *msg, string_buffer_t *buff ) Break on end of string */ if( !*pos ) + { break; - + } + start=pos; } } @@ -712,17 +708,17 @@ wchar_t *escape( const wchar_t *in, else { - switch( *in ) - { - case L'\t': - *(pos++) = L'\\'; - *(pos++) = L't'; - break; + switch( *in ) + { + case L'\t': + *(pos++) = L'\\'; + *(pos++) = L't'; + break; - case L'\n': - *(pos++) = L'\\'; - *(pos++) = L'n'; - break; + case L'\n': + *(pos++) = L'\\'; + *(pos++) = L'n'; + break; case L'\b': *(pos++) = L'\\'; -- cgit v1.2.3