mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-25 04:13:08 +00:00
Use ferror instead of checking errno to detect errors in read_file
glibc sets errno even though the file read did not have an error Fixes #1731
This commit is contained in:
parent
1665f84d60
commit
d7b3821c0a
1 changed files with 1 additions and 2 deletions
|
@ -54,11 +54,10 @@ static void read_file(FILE *f, wcstring &b)
|
|||
{
|
||||
while (1)
|
||||
{
|
||||
errno=0;
|
||||
wint_t c = fgetwc(f);
|
||||
if (c == WEOF)
|
||||
{
|
||||
if (errno)
|
||||
if (ferror(f))
|
||||
{
|
||||
wperror(L"fgetwc");
|
||||
exit(1);
|
||||
|
|
Loading…
Reference in a new issue