From 7fc84717e8a919fc69cbf2aeef6772bee0e21743 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 1 Dec 2013 15:01:56 -0400 Subject: [PATCH] avoid an unncessary use of the shell --- Utility/Batch.hs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Utility/Batch.hs b/Utility/Batch.hs index 98698ac266..958801e88a 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