Fix possibly uninitialized error
This commit is contained in:
+11
-9
@@ -373,7 +373,7 @@ curses_ext_cmd(void)
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
char cur_choice[BUFSZ];
|
char cur_choice[BUFSZ];
|
||||||
int matches = 0;
|
int matches = 0;
|
||||||
int *ecmatches;
|
int *ecmatches = NULL;
|
||||||
WINDOW *extwin = NULL, *extwin2 = NULL;
|
WINDOW *extwin = NULL, *extwin2 = NULL;
|
||||||
|
|
||||||
if (iflags.extmenu) {
|
if (iflags.extmenu) {
|
||||||
@@ -421,14 +421,16 @@ curses_ext_cmd(void)
|
|||||||
wclrtoeol(extwin);
|
wclrtoeol(extwin);
|
||||||
|
|
||||||
/* if we have an autocomplete command, AND it matches uniquely */
|
/* if we have an autocomplete command, AND it matches uniquely */
|
||||||
if (matches == 1) {
|
if (matches == 1 && ecmatches) {
|
||||||
struct ext_func_tab *ec = extcmds_getentry(ecmatches[0]);
|
struct ext_func_tab *ec = extcmds_getentry(ecmatches[0]);
|
||||||
|
|
||||||
curses_toggle_color_attr(extwin, NONE, A_UNDERLINE, ON);
|
if (ec) {
|
||||||
wmove(extwin, starty, (int) strlen(cur_choice) + startx + 2);
|
curses_toggle_color_attr(extwin, NONE, A_UNDERLINE, ON);
|
||||||
wprintw(extwin, "%s",
|
wmove(extwin, starty, (int) strlen(cur_choice) + startx + 2);
|
||||||
ec->ef_txt + (int) strlen(cur_choice));
|
wprintw(extwin, "%s",
|
||||||
curses_toggle_color_attr(extwin, NONE, A_UNDERLINE, OFF);
|
ec->ef_txt + (int) strlen(cur_choice));
|
||||||
|
curses_toggle_color_attr(extwin, NONE, A_UNDERLINE, OFF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
@@ -447,7 +449,7 @@ curses_ext_cmd(void)
|
|||||||
(void) mungspaces(cur_choice);
|
(void) mungspaces(cur_choice);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
matches = extcmds_match(cur_choice, ECM_IGNOREAC|ECM_EXACTMATCH, &ecmatches);
|
matches = extcmds_match(cur_choice, ECM_IGNOREAC|ECM_EXACTMATCH, &ecmatches);
|
||||||
if (matches == 1)
|
if (matches == 1 && ecmatches)
|
||||||
ret = ecmatches[0];
|
ret = ecmatches[0];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -481,7 +483,7 @@ curses_ext_cmd(void)
|
|||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
matches = extcmds_match(cur_choice, ECM_NOFLAGS, &ecmatches);
|
matches = extcmds_match(cur_choice, ECM_NOFLAGS, &ecmatches);
|
||||||
if (matches == 1)
|
if (matches == 1 && ecmatches)
|
||||||
ret = ecmatches[0];
|
ret = ecmatches[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user