From 343cee17029ec9fe60b4b6745d3f8b15d8fa84a1 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 14 Aug 2012 19:52:18 -0400 Subject: [PATCH] do not try opening empty selection in browser --- termite.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/termite.cc b/termite.cc index d1d2b4e..b8033a9 100644 --- a/termite.cc +++ b/termite.cc @@ -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");