fix single-quote-containing addon arguments harder

This commit is contained in:
Simon Michael 2014-04-15 13:07:43 -07:00
parent 0d1d3ed057
commit 9d10cfa180
2 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ words' s = map stripquotes $ fromparse $ parsewith p s
-- | Quote-aware version of unwords - single-quote strings which contain whitespace -- | Quote-aware version of unwords - single-quote strings which contain whitespace
unwords' :: [String] -> String 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. -- | Strip one matching pair of single or double quotes on the ends of a string.
stripquotes :: String -> String stripquotes :: String -> String

View File

@ -255,7 +255,7 @@ main = do
| isExternalCommand = do | isExternalCommand = do
let shellcmd = printf "%s-%s %s" progname cmd (unwords' argsaftercmd) :: String let shellcmd = printf "%s-%s %s" progname cmd (unwords' argsaftercmd) :: String
dbgM "external command selected" cmd dbgM "external command selected" cmd
dbgM "external command arguments" argsaftercmd dbgM "external command arguments" (map quoteIfNeeded argsaftercmd)
dbgM "running shell command" shellcmd dbgM "running shell command" shellcmd
system shellcmd >>= exitWith system shellcmd >>= exitWith