diff options
-rw-r--r-- | Command/WebApp.hs | 13 | ||||
-rw-r--r-- | Utility/WebApp.hs | 4 | ||||
-rw-r--r-- | debian/changelog | 2 |
3 files changed, 17 insertions, 2 deletions
diff --git a/Command/WebApp.hs b/Command/WebApp.hs index 575d17330..e8d657052 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -34,7 +34,7 @@ import Annex.Version import Control.Concurrent import Control.Concurrent.STM -import System.Process (env, std_out, std_err) +import System.Process (env, std_out, std_err, cwd) import Network.Socket (HostName) import System.Environment (getArgs) @@ -215,7 +215,16 @@ openBrowser mcmd htmlshim realurl outh errh = do where p = case mcmd of Just cmd -> proc cmd [htmlshim] - Nothing -> browserProc url + Nothing -> +#ifndef mingw32_HOST_OS + browserProc url +#else + {- Windows hack to avoid using the full path, + - which might contain spaces that cause problems + - for browserProc. -} + (browserProc (takeFileName htmlshim)) + { cwd = Just (takeDirectory htmlshim) } +#endif #ifdef __ANDROID__ {- Android does not support file:// urls, but neither is - the security of the url in the process table important diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 6af324e51..c5e2a439e 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -61,6 +61,10 @@ browserProc url = proc "am" ["start", "-a", "android.intent.action.VIEW", "-d", url] #else #ifdef mingw32_HOST_OS +-- Warning: On Windows, no quoting or escaping of the url seems possible, +-- so spaces in it will cause problems. One approach is to make the url +-- be a relative filename, and adjust the returned CreateProcess to change +-- to the directory it's in. browserProc url = proc "cmd" ["/c start " ++ url] #else browserProc url = proc "xdg-open" [url] diff --git a/debian/changelog b/debian/changelog index 4d0b91950..fb3f0fd1f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,8 @@ git-annex (5.20140607) UNRELEASED; urgency=medium * Avoid leaving behind .tmp files when failing in some cases, including importing files to a disk that is full. * Avoid bad commits after interrupted direct mode sync (or merge). + * Windows: Fix opening webapp when repository is in a directory with + spaces in the path. -- Joey Hess <joeyh@debian.org> Mon, 09 Jun 2014 14:44:09 -0400 |