do not try opening empty selection in browser

This commit is contained in:
Daniel Micay 2012-08-14 19:52:18 -04:00
parent 13758efba5
commit 343cee1702
1 changed files with 3 additions and 1 deletions

View File

@ -194,7 +194,9 @@ static void open_selection(VteTerminal *vte) {
if (browser_cmd[0]) {
AtkText *text = ATK_TEXT(vte_terminal_accessible_new(vte));
char *selection = atk_text_get_selection(text, 0, NULL, NULL);
launch_browser(selection);
if (selection[0]) {
launch_browser(selection);
}
g_free(selection);
} else {
g_printerr("no browser to open url");