diff options
author | Guillaume Nault <g.nault@alphalink.fr> | 2013-02-11 14:10:35 +0100 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2013-02-12 00:05:52 +0400 |
commit | 08c36cd9ba10be7d5948e0b7050ef10d05321375 (patch) | |
tree | 8382645904fa750fef7be9747ba1b7200e6eb0f9 /accel-pppd | |
parent | 66bc15812006bc9c9b393d07377a02492f720e38 (diff) | |
download | accel-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>
Diffstat (limited to 'accel-pppd')
-rw-r--r-- | accel-pppd/cli/cli.c | 1 |
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, ®exp_cmd_list, entry) if (pcre_exec(recmd->re, NULL, cmd, strlen(cmd), 0, 0, NULL, 0) >= 0) { |