diff options
author | Joey Hess <joey@kitenet.net> | 2011-02-25 01:13:01 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-02-25 01:13:01 -0400 |
commit | 836e71297b8e3b5bd6f89f7eb1198f59af985b0b (patch) | |
tree | 835db9db776b23552736422baf9794eb6a3ac5e5 /CopyFile.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 'CopyFile.hs')
-rw-r--r-- | CopyFile.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/CopyFile.hs b/CopyFile.hs index e913aa070..73d911a29 100644 --- a/CopyFile.hs +++ b/CopyFile.hs @@ -23,9 +23,11 @@ copyFile src dest = do boolSystem "cp" opts where opts = if SysConfig.cp_reflink_auto - then ["--reflink=auto", src, dest] + then ["--reflink=auto", src', dest'] else if SysConfig.cp_a - then ["-a", src, dest] + then ["-a", src', dest'] else if SysConfig.cp_p - then ["-p", src, dest] - else [src, dest] + then ["-p", src', dest'] + else [src', dest'] + src' = utilityEscape src + dest' = utilityEscape dest |