diff options
author | Quentin Young <qlyoung@nvidia.com> | 2021-03-18 20:31:35 +0100 |
---|---|---|
committer | Quentin Young <qlyoung@nvidia.com> | 2021-04-07 19:39:56 +0200 |
commit | 767f67a4560ce9cce41d0183aed46cb2495b7f9a (patch) | |
tree | 3b121258b748db3643b484c4ae7373ffd57945df /vtysh/vtysh.c | |
parent | Merge pull request #8415 from mjstapp/fix_ospf_keyid_config (diff) | |
download | frr-767f67a4560ce9cce41d0183aed46cb2495b7f9a.tar.xz frr-767f67a4560ce9cce41d0183aed46cb2495b7f9a.zip |
lib, vtysh: re-add support for spaces in 'find'
Lost ability to handle them in the regex patch
Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to '')
-rw-r--r-- | vtysh/vtysh.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 376418829..839d5dd1e 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -3719,19 +3719,19 @@ DEFUN (no_vtysh_output_file, DEFUN(find, find_cmd, - "find REGEX", + "find REGEX...", "Find CLI command matching a regular expression\n" "Search pattern (POSIX regex)\n") { - char *pattern = argv[1]->arg; const struct cmd_node *node; const struct cmd_element *cli; vector clis; - regex_t exp = {}; - + char *pattern = argv_concat(argv, argc, 1); int cr = regcomp(&exp, pattern, REG_NOSUB | REG_EXTENDED); + XFREE(MTYPE_TMP, pattern); + if (cr != 0) { switch (cr) { case REG_BADBR: |