From f7b2b362fa2165d3688ee0dd6a7afcaa2d15fe53 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Sat, 8 Aug 2009 02:22:24 +0200 Subject: XMonad.Actions.Search: removeColonPrefix shouldn't throw an exception if no :! Ignore-this: db0a25c0d615c3d8cb6ef31489919d91 darcs-hash:20090808002224-f7719-27d50f4f65324ac26594f0518081817aae17353c.gz --- XMonad/Actions/Search.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'XMonad/Actions/Search.hs') diff --git a/XMonad/Actions/Search.hs b/XMonad/Actions/Search.hs index 87e5ace..5d1a57c 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 -- cgit v1.2.3