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
Ariadne Conill 2025-03-07 09:26:16 -08:00
parent c0d188fb44
commit bfc9ded550
1 changed files with 1 additions and 5 deletions

View File

@ -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));
}