From ccfc909eb2e754cc4558e258c011e8c9000559f5 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Mon, 25 Jun 2012 02:59:39 +0530 Subject: [PATCH] Fixed crash caused by pressing pageup button --- reader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/reader.cpp b/reader.cpp index 9725f467a..d7f5235da 100644 --- a/reader.cpp +++ b/reader.cpp @@ -3213,7 +3213,11 @@ const wchar_t *reader_readline() case R_BEGINNING_OF_HISTORY: { - data->history_search.go_to_beginning(); + data->history_search = history_search_t(*data->history, data->command_line, HISTORY_SEARCH_TYPE_PREFIX); + data->history_search.go_to_beginning(); + wcstring new_text = data->history_search.current_string(); + set_command_line_and_position(new_text, new_text.size()); + break; }