cmdline: fix parsing
cmdline: fix parsing

When parsing a CLI, all the CLI instances are checked
one by one. Even if an instance already matches the CLI,
the parsing will not stop for ambiguous check.
The problem is that the following check may change the
parsing result of the previous one even if the following
instance doesn't match.

Use a temporary validate for the parsing result when
trying to match an instance and only store the result
when it matches, so the previous result has no chance
to be changed.

Fixes: af75078fece3 ("first public release")
Cc: stable@dpdk.org

Signed-off-by: Wenzhuo Lu <58cb9036bdff9a5412edc3b9f70e105ccf59954f@intel.com>
Acked-by: Olivier Matz <dfcc1510895413197abb4336e39bb0a3906cba71@6wind.com>

john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk,john-mcnamara-intel/dpdk