Fix minor diagnostic discrepancies in incrementals

* src/incremen.c (read_directory_file, get_gnu_dumpdir):
Be more consistent about fatal errors.
This commit is contained in:
Paul Eggert
2024-08-14 23:05:33 -07:00
parent ab7a14bd92
commit 6bc4c4bf96

View File

@@ -1349,15 +1349,16 @@ read_directory_file (void)
{
ebuf = buf + sizeof PACKAGE_NAME - 1;
if (*ebuf++ != '-')
ERROR((1, 0, _("Bad incremental file format")));
FATAL_ERROR ((0, 0, _("Bad incremental file format")));
for (; *ebuf != '-'; ebuf++)
if (!*ebuf)
ERROR((1, 0, _("Bad incremental file format")));
FATAL_ERROR ((0, 0, _("Bad incremental file format")));
ebuf++;
if (! ('0' <= *ebuf && *ebuf <= '0' + TAR_INCREMENTAL_VERSION
&& !c_isdigit (ebuf[1])))
ERROR ((1, 0, _("Unsupported incremental format version: %s"),
FATAL_ERROR ((0, 0,
_("Unsupported incremental format version: %s"),
ebuf));
incremental_version = *ebuf - '0';
}
@@ -1482,7 +1483,7 @@ get_gnu_dumpdir (struct tar_stat_info *stat_info)
mv_size_left (size);
data_block = find_next_block ();
if (!data_block)
ERROR ((1, 0, _("Unexpected EOF in archive")));
FATAL_ERROR ((0, 0, _("Unexpected EOF in archive")));
copied = available_space_after (data_block);
if (copied > size)
copied = size;