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:
6
paste.c
6
paste.c
@@ -133,7 +133,9 @@ main(int argc, char *argv[])
|
||||
|
||||
for (i = 0; i < argc; i++)
|
||||
if (dsc[i].fp != stdin && fshut(dsc[i].fp, argv[i]))
|
||||
ret = 1;
|
||||
ret |= fshut(dsc[i].fp, argv[i]);
|
||||
|
||||
return !!(fshut(stdin, "<stdin>") + fshut(stdout, "<stdout>")) || ret;
|
||||
ret |= fshut(stdin, "<stdin>") | fshut(stdout, "<stdout>");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user