diff options
author | Ondrej Zajicek <santiago@crfreenet.org> | 2009-02-12 13:41:34 +0100 |
---|---|---|
committer | Ondrej Zajicek <santiago@crfreenet.org> | 2009-02-12 13:41:34 +0100 |
commit | 80ac7dc18145baa04a05eee3a69d325087cb9472 (patch) | |
tree | cfb2f6c42bf34f8b22a4ec0fe36b8e0265dd67cb /client/client.c | |
parent | f9491630390da4de138961354433635729668b7d (diff) | |
download | bird-80ac7dc18145baa04a05eee3a69d325087cb9472.tar bird-80ac7dc18145baa04a05eee3a69d325087cb9472.zip |
Do not use ? for client-side help when in new BGP path syntax
Diffstat (limited to 'client/client.c')
-rw-r--r-- | client/client.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/client/client.c b/client/client.c index ce9bdb6..6e465bc 100644 --- a/client/client.c +++ b/client/client.c @@ -168,20 +168,24 @@ input_complete(int arg UNUSED, int key UNUSED) static int input_help(int arg, int key UNUSED) { - int i = 0; + int i, in_string, in_path; if (arg != 1) return rl_insert(arg, '?'); - while (i < rl_point) + + in_string = in_path = 0; + for (i = 0; i < rl_point; i++) { - if (rl_line_buffer[i++] == '"') - do - { - if (i >= rl_point) /* `?' inside quoted string -> insert */ - return rl_insert(1, '?'); - } - while (rl_line_buffer[i++] != '"'); + if (rl_line_buffer[i] == '"') + in_string = ! in_string; + else if ((rl_line_buffer[i] == '|') && (! in_string)) + in_path = ! in_path; } + + /* `?' inside string or path -> insert */ + if (in_string || in_path) + return rl_insert(1, '?'); + rl_begin_undo_group(); /* HACK: We want to display `?' at point position */ rl_insert_text("?"); rl_redisplay(); |