From 8d2564291d87c5014c76d7ffb8e06c19cec73b4c Mon Sep 17 00:00:00 2001 From: liljencrantz Date: Mon, 14 Jan 2008 02:49:05 +1000 Subject: [PATCH] Make sure fish_indent handles io erros darcs-hash:20080113164905-75c98-b090ce79fb50a260874951525218cac65a097a6d.gz --- fish_indent.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/fish_indent.c b/fish_indent.c index 3fcb54de3..59226ad81 100644 --- a/fish_indent.c +++ b/fish_indent.c @@ -55,9 +55,16 @@ static void read_file( FILE *f, string_buffer_t *b ) { while( 1 ) { + errno=0; wint_t c = fgetwc( f ); if( c == WEOF ) { + if( errno ) + { + wperror(L"fgetwc"); + exit(1); + } + break; }