aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-03-22 11:22:21 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2019-03-22 11:22:21 -0700
commit97acf152e06a8371327204f7f18b0dee726539d4 (patch)
tree2b8bb1286d0530b0c3e31e51ec19689ea1450f1d /src/Text/Pandoc
parentb3473df417a760bb3fc10ee71c76a834c4c05214 (diff)
downloadpandoc-97acf152e06a8371327204f7f18b0dee726539d4.tar.gz
fetchItem: don't treat UNC paths as protocol-relative URLs.
These are paths beginning `//?/UNC/...`. Closes #5127.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Class.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Class.hs b/src/Text/Pandoc/Class.hs
index dd0e35deb..9a3f2aa65 100644
--- a/src/Text/Pandoc/Class.hs
+++ b/src/Text/Pandoc/Class.hs
@@ -569,7 +569,8 @@ downloadOrRead s = do
case parseURIReference' s' of
Just u' -> openURL $ show $ u' `nonStrictRelativeTo` u
Nothing -> openURL s' -- will throw error
- (Nothing, s'@('/':'/':_)) -> -- protocol-relative URI
+ (Nothing, s'@('/':'/':c:_)) | c /= '?' -> -- protocol-relative URI
+ -- we exclude //? because of //?UNC/ on Windows
case parseURIReference' s' of
Just u' -> openURL $ show $ u' `nonStrictRelativeTo` httpcolon
Nothing -> openURL s' -- will throw error