--- breakpoint.c | 17 ----------------- cli/cli-utils.c | 14 ++++++++++++++ cli/cli-utils.h | 6 ++++++ 3 files changed, 20 insertions(+), 17 deletions(-) --- a/breakpoint.c +++ b/breakpoint.c @@ -10862,23 +10862,6 @@ watch_command_wrapper (char *arg, int fr watch_command_1 (arg, hw_write, from_tty, 0, internal); } -/* A helper function that looks for an argument at the start of a - string. The argument must also either be at the end of the string, - or be followed by whitespace. Returns 1 if it finds the argument, - 0 otherwise. If the argument is found, it updates *STR. */ - -static int -check_for_argument (char **str, char *arg, int arg_len) -{ - if (strncmp (*str, arg, arg_len) == 0 - && ((*str)[arg_len] == '\0' || isspace ((*str)[arg_len]))) - { - *str += arg_len; - return 1; - } - return 0; -} - /* A helper function that looks for the "-location" argument and then calls watch_command_1. */ --- a/cli/cli-utils.c +++ b/cli/cli-utils.c @@ -286,3 +286,17 @@ extract_arg (char **arg) return copy; } + +/* See documentation in cli-utils.h. */ + +int +check_for_argument (char **str, char *arg, int arg_len) +{ + if (strncmp (*str, arg, arg_len) == 0 + && ((*str)[arg_len] == '\0' || isspace ((*str)[arg_len]))) + { + *str += arg_len; + return 1; + } + return 0; +} --- a/cli/cli-utils.h +++ b/cli/cli-utils.h @@ -114,4 +114,10 @@ extern char *remove_trailing_whitespace extern char *extract_arg (char **arg); +/* A helper function that looks for an argument at the start of a + string. The argument must also either be at the end of the string, + or be followed by whitespace. Returns 1 if it finds the argument, + 0 otherwise. If the argument is found, it updates *STR. */ +extern int check_for_argument (char **str, char *arg, int arg_len); + #endif /* CLI_UTILS_H */