diff options
Diffstat (limited to 'bin/rm')
-rw-r--r-- | bin/rm/rm.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/bin/rm/rm.c b/bin/rm/rm.c index 0161c82..f2665ed 100644 --- a/bin/rm/rm.c +++ b/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; |