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>
This commit is contained in:
Quentin Young 2021-03-18 15:31:35 -04:00
parent c53b1ff198
commit 767f67a456
2 changed files with 7 additions and 6 deletions

View file

@ -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) {

View file

@ -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: