libpkgconf: fileio: stop considering an empty buffer as a read failure
This is to be expected with truncated and empty lines in .pc files anyway. Related: https://github.com/pkgconf/pkgconf/issues/384 Signed-off-by: Ariadne Conill <ariadne@ariadne.space>master
parent
c0d188fb44
commit
bfc9ded550
|
@ -102,10 +102,6 @@ pkgconf_fgetline(pkgconf_buffer_t *buffer, FILE *stream)
|
|||
|
||||
}
|
||||
|
||||
|
||||
if (c == EOF && ((!buffer->base || !*buffer->base) || ferror(stream)))
|
||||
return false;
|
||||
|
||||
/* Remove newline character. */
|
||||
if (pkgconf_buffer_lastc(buffer) == '\n')
|
||||
pkgconf_buffer_trim_byte(buffer);
|
||||
|
@ -113,5 +109,5 @@ pkgconf_fgetline(pkgconf_buffer_t *buffer, FILE *stream)
|
|||
if (pkgconf_buffer_lastc(buffer) == '\r')
|
||||
pkgconf_buffer_trim_byte(buffer);
|
||||
|
||||
return true;
|
||||
return !(c == EOF || ferror(stream));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue