From ecab4a6dba4f3b88c2bc72c188dd03913cdcfbfc Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 18 Sep 2012 07:56:59 -0400 Subject: [PATCH] id needs to be converted to the actual index --- termite.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/termite.cc b/termite.cc index 0396153..1fd9d26 100644 --- a/termite.cc +++ b/termite.cc @@ -137,8 +137,8 @@ static void launch_url(const char *text, search_panel_info *info) { errno = 0; unsigned long id = strtoul(text, &end, 10); - if (!errno && end != text && *end == '\0' && id < info->url_list.size()) { - browser_cmd[1] = info->url_list[id].url; + if (!errno && end != text && *end == '\0' && id && id < info->url_list.size()) { + browser_cmd[1] = info->url_list[id - 1].url; g_spawn_async(NULL, (char **)browser_cmd, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL); } else { g_printerr("url hint invalid\n");