fix: Escape special symbols when passing arguments to addons
This commit is contained in:
parent
abc559f39a
commit
8cbe4c6003
@ -452,9 +452,9 @@ main = handleExit $ withGhcDebug' $ do
|
||||
let
|
||||
addonargs0 = filter (/="--") $ supportedgenargsfromconf <> confcmdargs <> cliargswithoutcmd
|
||||
addonargs = dropCliSpecificOpts addonargs0
|
||||
shellcmd = printf "%s-%s %s" progname cmdname (unwords' addonargs) :: String
|
||||
shellcmd = printf "%s-%s %s" progname cmdname (unwords $ map quoteForCommandLine addonargs) :: String
|
||||
dbgio "addon command selected" cmdname
|
||||
dbgio "addon command arguments after removing cli-specific opts" (map quoteIfNeeded addonargs)
|
||||
dbgio "addon command arguments" addonargs
|
||||
dbg1IO "running addon" shellcmd
|
||||
system shellcmd >>= exitWith
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ runCommand defaultJournalOverride findBuiltinCommand addons cmdline = do
|
||||
then run (Just jpaths) findBuiltinCommand addons opts
|
||||
else cmdaction opts j
|
||||
Nothing | cmdname `elem` addons ->
|
||||
system (printf "%s-%s %s" progname cmdname (unwords' args)) >>= exitWith
|
||||
system (printf "%s-%s %s" progname cmdname (unwords $ map quoteForCommandLine args)) >>= exitWith
|
||||
Nothing ->
|
||||
error' $ "Unrecognized command: " ++ unwords (cmdname:args)
|
||||
[] -> return ()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user