From 08c36cd9ba10be7d5948e0b7050ef10d05321375 Mon Sep 17 00:00:00 2001 From: Guillaume Nault Date: Mon, 11 Feb 2013 14:10:35 +0100 Subject: cli: Skip leading spaces before calling regexp cmds Call regexp command handler without command line's leading spaces. This makes leading spaces handling consistent between the exec and help command handlers (leading spaces are already skipped before calling help handlers). This also gives the possibility to register an anchored regexp command without having to manage the leading spaces in that regexp. Signed-off-by: Guillaume Nault --- accel-pppd/cli/cli.c | 1 + 1 file changed, 1 insertion(+) (limited to 'accel-pppd/cli') diff --git a/accel-pppd/cli/cli.c b/accel-pppd/cli/cli.c index a9d5a4cc..202e42dc 100644 --- a/accel-pppd/cli/cli.c +++ b/accel-pppd/cli/cli.c @@ -228,6 +228,7 @@ static int cli_process_regexp_cmd(struct cli_client_t *cln, int *err) int found = 0; int res; + cmd = skip_space(cmd); list_for_each_entry(recmd, ®exp_cmd_list, entry) if (pcre_exec(recmd->re, NULL, cmd, strlen(cmd), 0, 0, NULL, 0) >= 0) { -- cgit v1.2.3