[Surfraw-devel] [PATCH] Fixed occurence of empty menu item

Sumant Oemrawsingh soemraws at xs4all.nl
Sat May 1 00:17:38 UTC 2010


A space and tab in the bookfinder elvi description messed up the menu
presented by uzbl_load_url_from_surfraw. Cut used the tab character as a
delimiter, so the space became an entry on its own. Using awk instead of cut
fixes this problem.
---
 examples/uzbl_load_url_from_surfraw.IN |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/examples/uzbl_load_url_from_surfraw.IN b/examples/uzbl_load_url_from_surfraw.IN
index 37572ef..a1fb839 100755
--- a/examples/uzbl_load_url_from_surfraw.IN
+++ b/examples/uzbl_load_url_from_surfraw.IN
@@ -77,7 +77,7 @@ function goto()
 # Use dmenu to navigate through possible choices
 function present_menu()
 {
-  elvi=`surfraw -elvi | grep -v -e ' ELVI:' -e '^W' | cut -f 1`
+  elvi=`surfraw -elvi | grep -v -e ' ELVI:' -e '^W' | awk '{print $1}'`
   if [ -r "$BOOKMARKS" ]
   then
     elvi="$elvi $(awk '{print $1}' "$BOOKMARKS" 2>/dev/null)"
-- 
1.6.4.4




More information about the Surfraw-devel mailing list