summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/cio.cc10
-rw-r--r--crawl-ref/source/ng-input.cc8
2 files changed, 11 insertions, 7 deletions
diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc
index 370492536b..13059d67fd 100644
--- a/crawl-ref/source/cio.cc
+++ b/crawl-ref/source/cio.cc
@@ -401,7 +401,7 @@ void line_reader::cursorto(int ncx)
{
int x = (start_x + ncx - 1) % wrapcol + 1;
int y = start_y + (start_x + ncx - 1) / wrapcol;
- ::cgotoxy(x, y, get_cursor_region());
+ cgotoxy(x, y, get_cursor_region());
}
int line_reader::read_line(bool clear_previous)
@@ -417,6 +417,12 @@ int line_reader::read_line(bool clear_previous)
start_x = wherex();
start_y = wherey();
+#ifndef USE_TILE
+ // FIXME: what exactly is going on here?
+ // Update the active region.
+ cgotoxy(start_x, start_y, GOTO_CRT);
+#endif
+
length = strlen(buffer);
// Remember the previous cursor position, if valid.
@@ -479,7 +485,7 @@ void line_reader::backspace()
char *c = cur;
while (*c)
{
- *c = c[1];
+ *c = *(c+1);
c++;
}
--pos;
diff --git a/crawl-ref/source/ng-input.cc b/crawl-ref/source/ng-input.cc
index 499a3e2143..4a097049f8 100644
--- a/crawl-ref/source/ng-input.cc
+++ b/crawl-ref/source/ng-input.cc
@@ -178,17 +178,15 @@ static bool _read_player_name(std::string &name,
if (ret == CK_ESCAPE)
return (false);
- if (ret != CK_ESCAPE && existing.size())
+ if (!existing.empty())
{
menu.set_search(name);
menu.show();
const MenuEntry *sel = menu.selected_entry();
if (sel)
{
- const player_save_info &p =
- *static_cast<player_save_info*>( sel->data );
- name = p.name;
- return (true);
+ name = static_cast<player_save_info*>(sel->data)->name;
+ return true;
}
}