mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-28 04:43:32 +00:00
No need to check for "-" explicitly in getopt() loop.
This commit is contained in:
parent
c87180589e
commit
6e473901a3
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97985
@ -72,7 +72,7 @@ main(argc, argv)
|
||||
int ch, fd1, fd2, special;
|
||||
const char *file1, *file2;
|
||||
|
||||
while ((ch = getopt(argc, argv, "-lsxz")) != -1)
|
||||
while ((ch = getopt(argc, argv, "lsxz")) != -1)
|
||||
switch (ch) {
|
||||
case 'l': /* print all differences */
|
||||
lflag = 1;
|
||||
@ -88,14 +88,10 @@ main(argc, argv)
|
||||
case 'z': /* compare size first */
|
||||
zflag = 1;
|
||||
break;
|
||||
case '-': /* stdin (must be after options) */
|
||||
--optind;
|
||||
goto endargs;
|
||||
case '?':
|
||||
default:
|
||||
usage();
|
||||
}
|
||||
endargs:
|
||||
argv += optind;
|
||||
argc -= optind;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user