Getting command name from busybox now gets applet name

This commit is contained in:
Vidar Holen 2017-02-12 10:56:29 -08:00
parent 46fb91b44d
commit 35c74e4747
2 changed files with 14 additions and 6 deletions

View file

@ -240,8 +240,15 @@ getCommand t =
-- Maybe get the command name of a token representing a command
getCommandName t = do
(T_SimpleCommand _ _ (w:_)) <- getCommand t
getLiteralString w
(T_SimpleCommand _ _ (w:rest)) <- getCommand t
s <- getLiteralString w
if "busybox" `isSuffixOf` s
then
case rest of
(applet:_) -> getLiteralString applet
_ -> return s
else
return s
-- If a command substitution is a single command, get its name.
-- $(date +%s) = Just "date"