diff --git a/hledger-lib/Hledger/Utils.hs b/hledger-lib/Hledger/Utils.hs index 34d66c43c..dbb30a8cb 100644 --- a/hledger-lib/Hledger/Utils.hs +++ b/hledger-lib/Hledger/Utils.hs @@ -136,7 +136,7 @@ words' s = map stripquotes $ fromparse $ parsewith p s -- | Quote-aware version of unwords - single-quote strings which contain whitespace unwords' :: [String] -> String -unwords' = unwords . map singleQuoteIfNeeded +unwords' = unwords . map quoteIfNeeded -- | Strip one matching pair of single or double quotes on the ends of a string. stripquotes :: String -> String diff --git a/hledger/Hledger/Cli/Main.hs b/hledger/Hledger/Cli/Main.hs index 1b748bdae..dca74b540 100644 --- a/hledger/Hledger/Cli/Main.hs +++ b/hledger/Hledger/Cli/Main.hs @@ -255,7 +255,7 @@ main = do | isExternalCommand = do let shellcmd = printf "%s-%s %s" progname cmd (unwords' argsaftercmd) :: String dbgM "external command selected" cmd - dbgM "external command arguments" argsaftercmd + dbgM "external command arguments" (map quoteIfNeeded argsaftercmd) dbgM "running shell command" shellcmd system shellcmd >>= exitWith