aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Actions/Search.hs
diff options
context:
space:
mode:
authorgwern0 <gwern0@gmail.com>2009-08-08 02:22:24 +0200
committergwern0 <gwern0@gmail.com>2009-08-08 02:22:24 +0200
commitf7b2b362fa2165d3688ee0dd6a7afcaa2d15fe53 (patch)
treeadf42a6b1bee2b342ceaca9be1b42faff624557a /XMonad/Actions/Search.hs
parentad14ea782b6a1fa84b642cf2fbb8ac571e4c4813 (diff)
downloadXMonadContrib-f7b2b362fa2165d3688ee0dd6a7afcaa2d15fe53.tar.gz
XMonadContrib-f7b2b362fa2165d3688ee0dd6a7afcaa2d15fe53.tar.xz
XMonadContrib-f7b2b362fa2165d3688ee0dd6a7afcaa2d15fe53.zip
XMonad.Actions.Search: removeColonPrefix shouldn't throw an exception if no :!
Ignore-this: db0a25c0d615c3d8cb6ef31489919d91 darcs-hash:20090808002224-f7719-27d50f4f65324ac26594f0518081817aae17353c.gz
Diffstat (limited to 'XMonad/Actions/Search.hs')
-rw-r--r--XMonad/Actions/Search.hs2
1 files changed, 1 insertions, 1 deletions
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