paste: No need to make an exception for stdin, just close it at the end

This commit is contained in:
sin 2015-02-10 12:08:06 +00:00
parent 1c6298103e
commit 0779d69df7

View File

@ -120,10 +120,8 @@ main(int argc, char *argv[])
dsc[i].fp = stdin;
else
dsc[i].fp = fopen(argv[i], "r");
if (!dsc[i].fp)
eprintf("fopen %s:", argv[i]);
dsc[i].name = argv[i];
}
@ -132,10 +130,8 @@ main(int argc, char *argv[])
else
parallel(dsc, argc, delim, len);
for (i = 0; i < argc; i++) {
if (dsc[i].fp != stdin)
(void)fclose(dsc[i].fp);
}
for (i = 0; i < argc; i++)
fclose(dsc[i].fp);
return 0;
}