From: adilger Date: Fri, 26 Jul 2002 18:07:17 +0000 (+0000) Subject: Fix unused variable warning. X-Git-Tag: v1_7_100~5213 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=0ed9900dc2c4f6093b8467845ad6f295b9f43f29;p=fs%2Flustre-release.git Fix unused variable warning. --- diff --git a/lustre/utils/parser.c b/lustre/utils/parser.c index 88a18cf..ffd0075 100644 --- a/lustre/utils/parser.c +++ b/lustre/utils/parser.c @@ -43,7 +43,6 @@ extern void add_history(char *); static command_t * top_level; /* Top level of commands, initialized by * InitParser */ -static command_t * match_tbl; /* Command completion against this table */ static char * parser_prompt = NULL;/* Parser prompt, set by InitParser */ static int done; /* Set to 1 if user types exit or quit */ @@ -184,23 +183,25 @@ static int process(char *s, char ** next, command_t *lookup, } #ifdef HAVE_LIBREADLINE -static char * command_generator(const char * text, int state) +static command_t * match_tbl; /* Command completion against this table */ + +static char * command_generator(const char * text, int state) { static int index, len; char *name; /* Do we have a match table? */ - if (!match_tbl) + if (!match_tbl) return NULL; - + /* If this is the first time called on this word, state is 0 */ if (!state) { index = 0; len = (int)strlen(text); } - /* Return the next name in the command list that paritally matches test */ + /* Return next name in the command list that paritally matches test */ while ( (name = (match_tbl + index)->pc_name) ) { index++; @@ -214,7 +215,7 @@ static char * command_generator(const char * text, int state) } /* probably called by readline */ -static char **command_completion(char * text, int start, int end) +static char **command_completion(char * text, int start, int end) { command_t * table; char * pos;