1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-20 02:36:16 +02:00

tsort: diagnose errors reading the input

* src/tsort.c (tsort): Check for errors after readtoken().
* NEWS: Mention the bug fix.
This commit is contained in:
Pádraig Brady
2023-04-22 21:41:53 +01:00
parent 9d333aca43
commit 0e62ba282e
2 changed files with 8 additions and 1 deletions

3
NEWS
View File

@@ -11,6 +11,9 @@ GNU coreutils NEWS -*- outline -*-
Previously such file names would have caused the strip process to fail.
[This bug was present in "the beginning".]
tsort now diagnoses read errors on the input.
[This bug was present in "the beginning".]
* Noteworthy changes in release 9.3 (2023-04-18) [stable]

View File

@@ -453,7 +453,11 @@ tsort (char const *file)
/* T2. Next Relation. */
size_t len = readtoken (stdin, DELIM, sizeof (DELIM) - 1, &tokenbuffer);
if (len == (size_t) -1)
break;
{
if (ferror (stdin))
die (EXIT_FAILURE, errno, _("%s: read error"), quotef (file));
break;
}
assert (len != 0);