aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-07-05 16:03:44 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-07-05 16:06:39 +0530
commita1319cb8aa4b0942c2956ae0f202e918066ae67a (patch)
treeca4d8449e638bf6b48aa483f0e409133228b94b3 /reader.cpp
parent35c49d62d7f5666f437ded080bcc1a2386b96dc6 (diff)
Fixed crash caused by pressing pageup button when no match (for typed command) in history is found
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/reader.cpp b/reader.cpp
index 77f464f9..99755f19 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -3196,8 +3196,10 @@ const wchar_t *reader_readline()
{
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());
+ if (! data->history_search.is_at_end()) {
+ wcstring new_text = data->history_search.current_string();
+ set_command_line_and_position(new_text, new_text.size());
+ }
break;
}