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
sed.c
6
sed.c
@@ -1682,7 +1682,7 @@ int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
char *arg;
|
||||
int script = 0;
|
||||
int ret = 0, script = 0;
|
||||
|
||||
ARGBEGIN {
|
||||
case 'n':
|
||||
@@ -1717,5 +1717,7 @@ main(int argc, char *argv[])
|
||||
files = argv;
|
||||
run();
|
||||
|
||||
return !!(fshut(stdin, "<stdin>") + fshut(stdout, "<stdout>"));
|
||||
ret |= fshut(stdin, "<stdin>") | fshut(stdout, "<stdout>");
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
Reference in New Issue
Block a user