27 |
unsigned opt; |
unsigned opt; |
28 |
|
|
29 |
opt_complementary = "f-i:i-f"; |
opt_complementary = "f-i:i-f"; |
30 |
opt = getopt32(argv, "fiRr"); |
/* -v (verbose) is ignored */ |
31 |
|
opt = getopt32(argv, "fiRrv"); |
32 |
argv += optind; |
argv += optind; |
33 |
if (opt & 1) |
if (opt & 1) |
34 |
flags |= FILEUTILS_FORCE; |
flags |= FILEUTILS_FORCE; |
35 |
if (opt & 2) |
if (opt & 2) |
36 |
flags |= FILEUTILS_INTERACTIVE; |
flags |= FILEUTILS_INTERACTIVE; |
37 |
if (opt & 12) |
if (opt & (8|4)) |
38 |
flags |= FILEUTILS_RECUR; |
flags |= FILEUTILS_RECUR; |
39 |
|
|
40 |
if (*argv != NULL) { |
if (*argv != NULL) { |
42 |
const char *base = bb_get_last_path_component_strip(*argv); |
const char *base = bb_get_last_path_component_strip(*argv); |
43 |
|
|
44 |
if (DOT_OR_DOTDOT(base)) { |
if (DOT_OR_DOTDOT(base)) { |
45 |
bb_error_msg("cannot remove '.' or '..'"); |
bb_error_msg("can't remove '.' or '..'"); |
46 |
} else if (remove_file(*argv, flags) >= 0) { |
} else if (remove_file(*argv, flags) >= 0) { |
47 |
continue; |
continue; |
48 |
} |
} |