From d38696bcd517938fa262b37b3cd3a237724b644a Mon Sep 17 00:00:00 2001 From: gwern0 Date: Sat, 8 Aug 2009 00:22:24 +0000 Subject: [PATCH] XMonad.Actions.Search: removeColonPrefix shouldn't throw an exception if no :! --- XMonad/Actions/Search.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index 87e5ace0..5d1a57c5 100644 --- a/XMonad/Actions/Search.hs +++ b/XMonad/Actions/Search.hs @@ -320,7 +320,7 @@ intelligent (SearchEngine name site) = searchEngineF name (\s -> if (fst $ break -- | > removeColonPrefix "foo://bar" ~> "//bar" -- > removeColonPrefix "foo//bar" ~> "foo//bar" removeColonPrefix :: String -> String -removeColonPrefix str = tail $ snd $ break (==':') str +removeColonPrefix s = if ':' `elem` s then drop 1 $ dropWhile (':' /=) s else s {- | Connects a few search engines into one. If the search engines\' names are \"s1\", \"s2\" and \"s3\", then the resulting engine will use s1 if the query