diff options
author | 2011-02-25 01:13:01 -0400 | |
---|---|---|
committer | 2011-02-25 01:13:01 -0400 | |
commit | 836e71297b8e3b5bd6f89f7eb1198f59af985b0b (patch) | |
tree | 835db9db776b23552736422baf9794eb6a3ac5e5 /RsyncFile.hs | |
parent | e61b47bc8a51447f9fbde6463e09d4beef8d5a7f (diff) |
Support filenames that start with a dash; when such a file is passed to a utility it will be escaped to avoid it being interpreted as an option.
Diffstat (limited to 'RsyncFile.hs')
-rw-r--r-- | RsyncFile.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/RsyncFile.hs b/RsyncFile.hs index 274e66151..9de2e2c59 100644 --- a/RsyncFile.hs +++ b/RsyncFile.hs @@ -24,11 +24,12 @@ rsyncShell command = ["-e", unwords $ map escape command] {- Runs rsync in server mode to send a file, and exits. -} rsyncServerSend :: FilePath -> IO () -rsyncServerSend file = rsyncExec $ rsyncServerParams ++ ["--sender", file] +rsyncServerSend file = rsyncExec $ + rsyncServerParams ++ ["--sender", utilityEscape file] {- Runs rsync in server mode to receive a file. -} rsyncServerReceive :: FilePath -> IO Bool -rsyncServerReceive file = rsync $ rsyncServerParams ++ [file] +rsyncServerReceive file = rsync $ rsyncServerParams ++ [utilityEscape file] rsyncServerParams :: [String] rsyncServerParams = |