diff options
author | hjan <hoeppner.jan@xurv.org> | 2015-03-22 01:37:17 +0000 |
---|---|---|
committer | hjan <hoeppner.jan@xurv.org> | 2015-03-22 01:37:17 +0000 |
commit | 19c3b0b1b2ab2d3a12cb04d3e368e45feec75d4e (patch) | |
tree | 1044a1aa94e60191885d7b08462c5b3a2624265a /history-search | |
parent | oops, escape the var in the documentation. Promise self to actually test befo... (diff) | |
download | irssi-scripts-19c3b0b1b2ab2d3a12cb04d3e368e45feec75d4e.tar.gz irssi-scripts-19c3b0b1b2ab2d3a12cb04d3e368e45feec75d4e.zip |
Fix use of uninitialized value
When looking up search-matches, the $match variable may be used
uninitialized. A simple check before the use avoids that.
Signed-off-by: hjan <hoeppner.jan@xurv.org>
Diffstat (limited to '')
-rw-r--r-- | history-search/rl_history_search.pl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/history-search/rl_history_search.pl b/history-search/rl_history_search.pl index 7402a83..1fe9923 100644 --- a/history-search/rl_history_search.pl +++ b/history-search/rl_history_search.pl @@ -396,9 +396,10 @@ sub next_match { sub update_input { my $match = get_history_match(); - # TODO: Use of uninitialized value in subroutine entry at /Users/shabble/projects/tmp/test/irssi-shab/scripts/rl_history_search.pl line 399. - Irssi::gui_input_set($match); # <--- here. - Irssi::gui_input_set_pos(length $match); + if ($match) { + Irssi::gui_input_set($match); + Irssi::gui_input_set_pos(length $match); + } } sub handle_keypress { |