From 767f67a4560ce9cce41d0183aed46cb2495b7f9a Mon Sep 17 00:00:00 2001 From: Quentin Young Date: Thu, 18 Mar 2021 15:31:35 -0400 Subject: lib, vtysh: re-add support for spaces in 'find' Lost ability to handle them in the regex patch Signed-off-by: Quentin Young --- lib/command.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/command.c') diff --git a/lib/command.c b/lib/command.c index 770e2fc5ac..d2798b5002 100644 --- a/lib/command.c +++ b/lib/command.c @@ -2226,18 +2226,19 @@ DEFUN (no_banner_motd, 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) { -- cgit v1.2.3