Merge branch 'NetHack-3.6.2-beta01' into NetHack-3.6.2
This commit is contained in:
@@ -115,6 +115,7 @@ curses_line_input_dialog(const char *prompt, char *answer, int buffer)
|
|||||||
height++;
|
height++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(tmpstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (iflags.window_inited) {
|
if (iflags.window_inited) {
|
||||||
@@ -231,9 +232,7 @@ curses_character_input_dialog(const char *prompt, const char *choices,
|
|||||||
|
|
||||||
wrefresh(askwin);
|
wrefresh(askwin);
|
||||||
} else {
|
} else {
|
||||||
linestr = curses_copy_of(askstr);
|
pline("%s", askstr);
|
||||||
pline("%s", linestr);
|
|
||||||
free(linestr);
|
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -305,9 +304,7 @@ curses_character_input_dialog(const char *prompt, const char *choices,
|
|||||||
/* Kludge to make prompt visible after window is dismissed
|
/* Kludge to make prompt visible after window is dismissed
|
||||||
when inputting a number */
|
when inputting a number */
|
||||||
if (digit(answer)) {
|
if (digit(answer)) {
|
||||||
linestr = curses_copy_of(askstr);
|
pline("%s", askstr);
|
||||||
pline("%s", linestr);
|
|
||||||
free(linestr);
|
|
||||||
curs_set(1);
|
curs_set(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -466,14 +463,16 @@ curses_create_nhmenu(winid wid)
|
|||||||
if (menu_item_ptr != NULL) {
|
if (menu_item_ptr != NULL) {
|
||||||
while (menu_item_ptr->next_item != NULL) {
|
while (menu_item_ptr->next_item != NULL) {
|
||||||
tmp_menu_item = menu_item_ptr->next_item;
|
tmp_menu_item = menu_item_ptr->next_item;
|
||||||
|
free((genericptr_t) menu_item_ptr->str);
|
||||||
free(menu_item_ptr);
|
free(menu_item_ptr);
|
||||||
menu_item_ptr = tmp_menu_item;
|
menu_item_ptr = tmp_menu_item;
|
||||||
}
|
}
|
||||||
|
free((genericptr_t) menu_item_ptr->str);
|
||||||
free(menu_item_ptr); /* Last entry */
|
free(menu_item_ptr); /* Last entry */
|
||||||
new_menu->entries = NULL;
|
new_menu->entries = NULL;
|
||||||
}
|
}
|
||||||
if (new_menu->prompt != NULL) { /* Reusing existing menu */
|
if (new_menu->prompt != NULL) { /* Reusing existing menu */
|
||||||
free((char *) new_menu->prompt);
|
free((genericptr_t) new_menu->prompt);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -692,9 +691,11 @@ curses_del_menu(winid wid)
|
|||||||
if (menu_item_ptr != NULL) {
|
if (menu_item_ptr != NULL) {
|
||||||
while (menu_item_ptr->next_item != NULL) {
|
while (menu_item_ptr->next_item != NULL) {
|
||||||
tmp_menu_item = menu_item_ptr->next_item;
|
tmp_menu_item = menu_item_ptr->next_item;
|
||||||
|
free((genericptr_t) menu_item_ptr->str);
|
||||||
free(menu_item_ptr);
|
free(menu_item_ptr);
|
||||||
menu_item_ptr = tmp_menu_item;
|
menu_item_ptr = tmp_menu_item;
|
||||||
}
|
}
|
||||||
|
free((genericptr_t) menu_item_ptr->str);
|
||||||
free(menu_item_ptr); /* Last entry */
|
free(menu_item_ptr); /* Last entry */
|
||||||
current_menu->entries = NULL;
|
current_menu->entries = NULL;
|
||||||
}
|
}
|
||||||
@@ -711,6 +712,7 @@ curses_del_menu(winid wid)
|
|||||||
tmpmenu->prev_menu = current_menu->prev_menu;
|
tmpmenu->prev_menu = current_menu->prev_menu;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free((genericptr_t) current_menu->prompt);
|
||||||
free(current_menu);
|
free(current_menu);
|
||||||
|
|
||||||
curses_del_wid(wid);
|
curses_del_wid(wid);
|
||||||
@@ -940,8 +942,8 @@ menu_display_page(nhmenu *menu, WINDOW * win, int page_num)
|
|||||||
{
|
{
|
||||||
nhmenu_item *menu_item_ptr;
|
nhmenu_item *menu_item_ptr;
|
||||||
int count, curletter, entry_cols, start_col, num_lines, footer_x;
|
int count, curletter, entry_cols, start_col, num_lines, footer_x;
|
||||||
|
char *tmpstr;
|
||||||
boolean first_accel = TRUE;
|
boolean first_accel = TRUE;
|
||||||
|
|
||||||
int color = NO_COLOR;
|
int color = NO_COLOR;
|
||||||
int attr = A_NORMAL;
|
int attr = A_NORMAL;
|
||||||
boolean menu_color = FALSE;
|
boolean menu_color = FALSE;
|
||||||
@@ -964,12 +966,13 @@ menu_display_page(nhmenu *menu, WINDOW * win, int page_num)
|
|||||||
|
|
||||||
werase(win);
|
werase(win);
|
||||||
|
|
||||||
if (strlen(menu->prompt) > 0) {
|
if (menu->prompt && *menu->prompt) {
|
||||||
num_lines = curses_num_lines(menu->prompt, menu->width);
|
num_lines = curses_num_lines(menu->prompt, menu->width);
|
||||||
|
|
||||||
for (count = 0; count < num_lines; count++) {
|
for (count = 0; count < num_lines; count++) {
|
||||||
mvwprintw(win, count + 1, 1, "%s",
|
tmpstr = curses_break_str(menu->prompt, menu->width, count + 1);
|
||||||
curses_break_str(menu->prompt, menu->width, count + 1));
|
mvwprintw(win, count + 1, 1, "%s", tmpstr);
|
||||||
|
free(tmpstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1029,9 +1032,9 @@ menu_display_page(nhmenu *menu, WINDOW * win, int page_num)
|
|||||||
start_col += 2;
|
start_col += 2;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (iflags.use_menu_color && (menu_color = get_menu_coloring
|
if (iflags.use_menu_color
|
||||||
((char *) menu_item_ptr->str, &color,
|
&& (menu_color = get_menu_coloring(menu_item_ptr->str,
|
||||||
&attr))) {
|
&color, &attr)) != 0) {
|
||||||
if (color != NO_COLOR) {
|
if (color != NO_COLOR) {
|
||||||
curses_toggle_color_attr(win, color, NONE, ON);
|
curses_toggle_color_attr(win, color, NONE, ON);
|
||||||
}
|
}
|
||||||
@@ -1045,11 +1048,12 @@ menu_display_page(nhmenu *menu, WINDOW * win, int page_num)
|
|||||||
num_lines = curses_num_lines(menu_item_ptr->str, entry_cols);
|
num_lines = curses_num_lines(menu_item_ptr->str, entry_cols);
|
||||||
|
|
||||||
for (count = 0; count < num_lines; count++) {
|
for (count = 0; count < num_lines; count++) {
|
||||||
if (strlen(menu_item_ptr->str) > 0) {
|
if (menu_item_ptr->str && *menu_item_ptr->str) {
|
||||||
mvwprintw(win, menu_item_ptr->line_num + count + 1,
|
tmpstr = curses_break_str(menu_item_ptr->str,
|
||||||
start_col, "%s", curses_break_str(menu_item_ptr->str,
|
entry_cols, count + 1);
|
||||||
entry_cols,
|
mvwprintw(win, menu_item_ptr->line_num + count + 1, start_col,
|
||||||
count + 1));
|
"%s", tmpstr);
|
||||||
|
free(tmpstr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (menu_color && (color != NO_COLOR)) {
|
if (menu_color && (color != NO_COLOR)) {
|
||||||
|
|||||||
@@ -617,11 +617,11 @@ mesg_add_line(char *mline)
|
|||||||
current_mesg->prev_mesg = last_mesg;
|
current_mesg->prev_mesg = last_mesg;
|
||||||
last_mesg = current_mesg;
|
last_mesg = current_mesg;
|
||||||
|
|
||||||
|
|
||||||
if (num_messages < max_messages) {
|
if (num_messages < max_messages) {
|
||||||
num_messages++;
|
num_messages++;
|
||||||
} else {
|
} else {
|
||||||
tmp_mesg = first_mesg->next_mesg;
|
tmp_mesg = first_mesg->next_mesg;
|
||||||
|
free(first_mesg->str);
|
||||||
free(first_mesg);
|
free(first_mesg);
|
||||||
first_mesg = tmp_mesg;
|
first_mesg = tmp_mesg;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user