summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2013-02-11 14:10:35 +0100
committerKozlov Dmitry <xeb@mail.ru>2013-02-12 00:05:52 +0400
commit08c36cd9ba10be7d5948e0b7050ef10d05321375 (patch)
tree8382645904fa750fef7be9747ba1b7200e6eb0f9
parent66bc15812006bc9c9b393d07377a02492f720e38 (diff)
downloadaccel-ppp-08c36cd9ba10be7d5948e0b7050ef10d05321375.tar.gz
accel-ppp-08c36cd9ba10be7d5948e0b7050ef10d05321375.zip
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 <g.nault@alphalink.fr>
-rw-r--r--accel-pppd/cli/cli.c1
1 files changed, 1 insertions, 0 deletions
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, &regexp_cmd_list, entry)
if (pcre_exec(recmd->re, NULL, cmd, strlen(cmd),
0, 0, NULL, 0) >= 0) {