aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--common.c1
-rw-r--r--reader.c24
2 files changed, 13 insertions, 12 deletions
diff --git a/common.c b/common.c
index 31e76034..4efe4fcb 100644
--- a/common.c
+++ b/common.c
@@ -815,7 +815,6 @@ void debug( int level, wchar_t *msg, ... )
sb_printf( &sb, L"%ls: ", program_name );
sb_vprintf( &sb, msg, va );
va_end( va );
-
if( screen_width )
{
diff --git a/reader.c b/reader.c
index a553ce95..f577a666 100644
--- a/reader.c
+++ b/reader.c
@@ -2377,23 +2377,25 @@ static int read_i()
return 0;
}
+/**
+ Test if there are bytes available for reading on the specified file
+ descriptor
+*/
static int can_read( int fd )
{
- struct pollfd pfd =
- {
- fd, POLLIN, 0
- }
+ struct pollfd pfd[] =
+ {
+ {
+ fd, POLLIN, 0
+ }
+ }
;
- switch( poll( &pfd, 1, 0 ) )
- {
- case 1:
- return 1;
- }
- return 0;
+ return poll( pfd, 1, 0 ) == 1;
}
/**
- Test if the specified character is in the private use area that fish uses to store internal characters
+ 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 )
{