o) Correct for missing whitespace.
o) We don't need to check if ifp == stdin to give the filename, since we already know that ifn will be "stdin" if it is.
This commit is contained in:
parent
705e551878
commit
070c749233
@ -116,7 +116,7 @@ main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
argc -= optind;
|
||||
argv +=optind;
|
||||
argv += optind;
|
||||
|
||||
/* If no flags are set, default is -d -u. */
|
||||
if (cflag) {
|
||||
@ -142,8 +142,8 @@ main (int argc, char *argv[])
|
||||
err(1, "malloc");
|
||||
|
||||
if (getline(prevline, MAXLINELEN, ifp) == NULL) {
|
||||
if (ferror(ifp))
|
||||
err(1, "%s", ifp == stdin ? "stdin" : argv[0]);
|
||||
if (ferror(ifp) || 1)
|
||||
err(1, "%s", ifn);
|
||||
exit(0);
|
||||
}
|
||||
if (!cflag && uflag && dflag)
|
||||
@ -178,7 +178,7 @@ main (int argc, char *argv[])
|
||||
++repeats;
|
||||
}
|
||||
if (ferror(ifp))
|
||||
err(1, "%s", ifp == stdin ? "stdin" : argv[0]);
|
||||
err(1, "%s", ifn);
|
||||
if (cflag || !dflag || !uflag)
|
||||
show(ofp, prevline);
|
||||
exit(0);
|
||||
|
Loading…
Reference in New Issue
Block a user