mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 01:36:39 +08:00
Make non-interactive reading more robust.
darcs-hash:20051216155010-ac50b-8237935c6e95c296fd67280b1879267f9e7a949b.gz
This commit is contained in:
parent
e6bd3dbc40
commit
9229041385
16
reader.c
16
reader.c
|
@ -3037,7 +3037,21 @@ static int read_ni( int fd )
|
|||
while(!feof( in_stream ))
|
||||
{
|
||||
char buff[4096];
|
||||
int c = fread(buff, 1, 4096, in_stream);
|
||||
int c;
|
||||
|
||||
c = fread(buff, 1, 4096, in_stream);
|
||||
if( ferror( in_stream ) )
|
||||
{
|
||||
debug( 1,
|
||||
L"Error while reading commands" );
|
||||
|
||||
/*
|
||||
Reset buffer. We won't evaluate incomplete files.
|
||||
*/
|
||||
acc.used=0;
|
||||
break;
|
||||
}
|
||||
|
||||
b_append( &acc, buff, c );
|
||||
}
|
||||
b_append( &acc, "\0", 1 );
|
||||
|
|
Loading…
Reference in New Issue
Block a user