summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2013-12-01 15:01:56 -0400
committerGravatar Joey Hess <joey@kitenet.net>2013-12-01 15:01:56 -0400
commit1376eb62e5b784b86e0bb2827e99d32d18aff5af (patch)
tree2a51281f8a2da4211f01c77023e186c1509a6bf2
parentc6c04581a8567e6b87c8df754947ac8779845507 (diff)
avoid an unncessary use of the shell
-rw-r--r--Utility/Batch.hs11
1 files changed, 3 insertions, 8 deletions
diff --git a/Utility/Batch.hs b/Utility/Batch.hs
index 98698ac26..958801e88 100644
--- a/Utility/Batch.hs
+++ b/Utility/Batch.hs
@@ -53,14 +53,9 @@ toBatchCommand (command, params) = do
, ("ionice", ["-c3"])
, ("nocache", [])
]
- let command' = "sh"
- let params' =
- [ Param "-c"
- , Param $ unwords $
- "exec"
- : concatMap (\p -> fst p : snd p) nicers
- ++ map shellEscape (command : toCommand params)
- ]
+ let (command', params') = case nicers of
+ [] -> (command, params)
+ (first:rest) -> (fst first, map Param (snd first ++ concatMap (\p -> fst p : snd p) rest ++ [command]) ++ params)
#else
let command' = command
let params' = params