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.
This commit is contained in:
parent
e61b47bc8a
commit
836e71297b
9 changed files with 29 additions and 10 deletions
10
CopyFile.hs
10
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue