diff options
Diffstat (limited to 'findutils/find.c')
-rw-r--r-- | findutils/find.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/findutils/find.c b/findutils/find.c index f8bccca..1e15e88 100644 --- a/findutils/find.c +++ b/findutils/find.c @@ -20,10 +20,6 @@ #include <time.h> #include <ctype.h> -//XXX just found out about libbb/messages.c . maybe move stuff there ? - ghoz -static const char msg_req_arg[] = "option `%s' requires an argument"; -static const char msg_invalid_arg[] = "invalid argument `%s' to `%s'"; - static char *pattern; #ifdef CONFIG_FEATURE_FIND_PRINT0 static char printsep = '\n'; @@ -188,7 +184,7 @@ static int find_type(char *type) } if (mask == 0 || type[1] != '\0') - bb_error_msg_and_die(msg_invalid_arg, type, "-type"); + bb_error_msg_and_die(bb_msg_invalid_arg, type, "-type"); return mask; } @@ -217,22 +213,22 @@ int find_main(int argc, char **argv) #endif else if (strcmp(argv[i], "-name") == 0) { if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-name"); + bb_error_msg_and_die(bb_msg_requires_arg, "-name"); pattern = argv[i]; #ifdef CONFIG_FEATURE_FIND_TYPE } else if (strcmp(argv[i], "-type") == 0) { if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-type"); + bb_error_msg_and_die(bb_msg_requires_arg, "-type"); type_mask = find_type(argv[i]); #endif #ifdef CONFIG_FEATURE_FIND_PERM } else if (strcmp(argv[i], "-perm") == 0) { char *end; if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-perm"); + bb_error_msg_and_die(bb_msg_requires_arg, "-perm"); perm_mask = strtol(argv[i], &end, 8); if ((end[0] != '\0') || (perm_mask > 07777)) - bb_error_msg_and_die(msg_invalid_arg, argv[i], "-perm"); + bb_error_msg_and_die(bb_msg_invalid_arg, argv[i], "-perm"); if ((perm_char = argv[i][0]) == '-') perm_mask = -perm_mask; #endif @@ -240,10 +236,10 @@ int find_main(int argc, char **argv) } else if (strcmp(argv[i], "-mtime") == 0) { char *end; if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-mtime"); + bb_error_msg_and_die(bb_msg_requires_arg, "-mtime"); mtime_days = strtol(argv[i], &end, 10); if (end[0] != '\0') - bb_error_msg_and_die(msg_invalid_arg, argv[i], "-mtime"); + bb_error_msg_and_die(bb_msg_invalid_arg, argv[i], "-mtime"); if ((mtime_char = argv[i][0]) == '-') mtime_days = -mtime_days; #endif @@ -251,10 +247,10 @@ int find_main(int argc, char **argv) } else if (strcmp(argv[i], "-mmin") == 0) { char *end; if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-mmin"); + bb_error_msg_and_die(bb_msg_requires_arg, "-mmin"); mmin_mins = strtol(argv[i], &end, 10); if (end[0] != '\0') - bb_error_msg_and_die(msg_invalid_arg, argv[i], "-mmin"); + bb_error_msg_and_die(bb_msg_invalid_arg, argv[i], "-mmin"); if ((mmin_char = argv[i][0]) == '-') mmin_mins = -mmin_mins; #endif @@ -281,7 +277,7 @@ int find_main(int argc, char **argv) } else if (strcmp(argv[i], "-newer") == 0) { struct stat stat_newer; if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-newer"); + bb_error_msg_and_die(bb_msg_requires_arg, "-newer"); xstat (argv[i], &stat_newer); newer_mtime = stat_newer.st_mtime; #endif @@ -289,10 +285,10 @@ int find_main(int argc, char **argv) } else if (strcmp(argv[i], "-inum") == 0) { char *end; if (++i == argc) - bb_error_msg_and_die(msg_req_arg, "-inum"); + bb_error_msg_and_die(bb_msg_requires_arg, "-inum"); inode_num = strtol(argv[i], &end, 10); if (end[0] != '\0') - bb_error_msg_and_die(msg_invalid_arg, argv[i], "-inum"); + bb_error_msg_and_die(bb_msg_invalid_arg, argv[i], "-inum"); #endif #ifdef CONFIG_FEATURE_FIND_EXEC } else if (strcmp(argv[i], "-exec") == 0) { @@ -301,14 +297,14 @@ int find_main(int argc, char **argv) while (i++) { if (i == argc) - bb_error_msg_and_die(msg_req_arg, "-exec"); + bb_error_msg_and_die(bb_msg_requires_arg, "-exec"); if (*argv[i] == ';') break; cmd_string = bb_xasprintf("%s %s", cmd_string, argv[i]); } if (*cmd_string == 0) - bb_error_msg_and_die(msg_req_arg, "-exec"); + bb_error_msg_and_die(bb_msg_requires_arg, "-exec"); cmd_string++; exec_str = xmalloc(sizeof(char *)); |