summaryrefslogtreecommitdiff
path: root/pandoc.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2014-06-27 18:30:57 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2014-06-27 18:30:57 -0700
commitb1a8f1fa1ad8a6083f0e00cf786eaeff5f10c3be (patch)
treed09a8f3555a94e702398a84cdee7a551cb66c1df /pandoc.hs
parentb2127311cb360479dbea59264ada0112a94d7819 (diff)
Fixed `--filter` so it doesn't search PATH for a filter with a path.
This fixed a bug wherein `--filter ./caps.py` would run `caps.py` from the system path, even if there was a `caps.py` in the working directory.
Diffstat (limited to 'pandoc.hs')
-rw-r--r--pandoc.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/pandoc.hs b/pandoc.hs
index 588723322..6281113cb 100644
--- a/pandoc.hs
+++ b/pandoc.hs
@@ -96,7 +96,9 @@ isTextFormat s = takeWhile (`notElem` "+-") s `notElem` ["odt","docx","epub","ep
externalFilter :: FilePath -> [String] -> Pandoc -> IO Pandoc
externalFilter f args' d = do
- mbexe <- findExecutable f
+ mbexe <- if '/' `elem` f -- don't check PATH if filter name it has a path
+ then return Nothing
+ else findExecutable f
(f', args'') <- case mbexe of
Just x -> return (x, args')
Nothing -> do