If an incorrect option value has been passed to a filter, it is possible
that library operations continue without even printing a warning.
This can happen because the special value "ARCHIVE_WARN - 1" is only
checked for filter issues, not format issues. Since this special value
is larger than ARCHIVE_FAILED, such failures are silently discarded.
Fix this by checking for this magic value for formats as well.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
if (r2 == ARCHIVE_FATAL)
return (ARCHIVE_FATAL);
- if (r2 == ARCHIVE_WARN - 1)
+ if (r1 == ARCHIVE_WARN - 1)
+ return r2;
+ if (r2 == ARCHIVE_WARN -1)
return r1;
return r1 > r2 ? r1 : r2;
}