X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Fparser.c;h=26f66d86576a569ce7f374bd7e1197fc8fcd24fd;hb=73107bf8aae7d4498de058d206319334ab8751d6;hp=a2bbe205396257e198956e9f5be8af682d05cb8f;hpb=c5050e412572b00cbe93d8517d2d1f767bebfa92;p=fs%2Flustre-release.git diff --git a/lustre/utils/parser.c b/lustre/utils/parser.c index a2bbe20..26f66d8 100644 --- a/lustre/utils/parser.c +++ b/lustre/utils/parser.c @@ -34,7 +34,7 @@ /* completion_matches() is #if 0-ed out in modern glibc */ #ifndef completion_matches -#define completion_matches rl_completion_matches +# define completion_matches rl_completion_matches #endif extern void using_history(void); extern void stifle_history(int); @@ -248,18 +248,19 @@ static char * command_generator(const char * text, int state) /* probably called by readline */ static char **command_completion(char * text, int start, int end) { - command_t * table; + command_t * table; char * pos; match_tbl = top_level; + for (table = find_cmd(rl_line_buffer, match_tbl, &pos); - table; - table = find_cmd(pos, match_tbl, &pos)) { + table; table = find_cmd(pos, match_tbl, &pos)) + { if (*(pos - 1) == ' ') match_tbl = table->pc_sub_cmd; } - return(completion_matches(text, command_generator)); + return completion_matches(text, command_generator); } #endif