- if (argc < 1 && forceFlag == FALSE) {
- usage(rm_usage);
- }
-
- while (argc-- > 0) {
- srcName = *(argv++);
- if (forceFlag == TRUE && lstat(srcName, &statbuf) != 0
- && errno == ENOENT) {
- /* do not reports errors for non-existent files if -f, just skip them */
- } else {
- if (recursiveAction(srcName, recursiveFlag, FALSE,
- TRUE, fileAction, dirAction, NULL) == FALSE) {
- exit(FALSE);
+ if ((base[0] == '.') && (!base[1] || ((base[1] == '.') && !base[2]))) {
+ bb_error_msg("cannot remove `.' or `..'");
+ } else if (remove_file(*argv, flags) >= 0) {
+ continue;