Simplify return & fshut() logic
Get rid of the !!()-constructs and use ret where available (or introduce it). In some cases, there would be an "abort" on the first fshut-error, but we want to close all files and report all warnings and then quit, not just the warning for the first file.
This commit is contained in:
@@ -102,6 +102,7 @@ main(int argc, char *argv[])
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
void (*uuencode_f)(FILE *, const char *, const char *) = uuencode;
|
||||
int ret = 0;
|
||||
|
||||
ARGBEGIN {
|
||||
case 'm':
|
||||
@@ -122,6 +123,8 @@ main(int argc, char *argv[])
|
||||
uuencode_f(fp, argv[1], argv[0]);
|
||||
}
|
||||
|
||||
return !!((fp && fshut(fp, argv[0])) + fshut(stdin, "<stdin>") +
|
||||
fshut(stdout, "<stdout>"));
|
||||
ret |= fp && fshut(fp, argv[0]);
|
||||
ret |= fshut(stdin, "<stdin>") | fshut(stdout, "<stdout>");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user