id needs to be converted to the actual index

This commit is contained in:
Daniel Micay 2012-09-18 07:56:59 -04:00
parent eb622a0b8a
commit ecab4a6dba
1 changed files with 2 additions and 2 deletions

View File

@ -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");