This is an archive of the discontinued LLVM Phabricator instance.

Fix check for options in "command alias"
ClosedPublic

Authored by ted on Apr 6 2015, 10:15 AM.

Details

Summary

"command alias" can add invalid options to the command. "command alias start process launch -s" will add an extra argument, "<no-argument>" to the alias, so it runs "process launch -s <no-argument>", which launches the process with args that include "<no-argument>".

This patch changes the text compare of the variable value with "<OptionParser::eNoArgument>" to a compare of variable value_type with OptionParser::eNoArgument. It also moves the previous test inside the if, so it won't add a trailing space if there is no argument.

Diff Detail

Repository
rL LLVM

Event Timeline

ted updated this revision to Diff 23281.Apr 6 2015, 10:15 AM
ted retitled this revision from to Fix check for options in "command alias".
ted updated this object.
ted edited the test plan for this revision. (Show Details)
ted added a reviewer: clayborg.
ted added a subscriber: Unknown Object (MLST).
clayborg accepted this revision.Apr 6 2015, 11:30 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Apr 6 2015, 11:30 AM
ted closed this revision.Apr 6 2015, 2:58 PM
This revision was automatically updated to reflect the committed changes.