mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-30 08:19:09 +00:00
Reject options, handle "--" correctly in unlink(1).
This commit is contained in:
parent
69eafeae74
commit
e9393a92a6
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97533
11
bin/rm/rm.c
11
bin/rm/rm.c
@ -95,11 +95,14 @@ main(int argc, char *argv[])
|
||||
else
|
||||
++p;
|
||||
if (strcmp(p, "unlink") == 0) {
|
||||
if (argc == 2) {
|
||||
rm_file(&argv[1]);
|
||||
exit(eval);
|
||||
} else
|
||||
while (getopt(argc, argv, "") != -1)
|
||||
usage();
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
if (argc == 0)
|
||||
usage();
|
||||
rm_file(&argv[0]);
|
||||
exit(eval);
|
||||
}
|
||||
|
||||
Pflag = rflag = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user