policycoreutils: fixfiles: handle unexpected spaces in command

I accidently ran `fixfiles "a b"` during testing.  Let's fix this too.
Before:

   /sbin/fixfiles: line 394: [: a: binary operator expected

   Usage: ...

After:

    Usage: ...

Signed-off-by: Alan Jenkins <alan.christopher.jenkins@gmail.com>
This commit is contained in:
Alan Jenkins 2017-03-26 15:35:51 +01:00 committed by James Carter
parent 8c662db964
commit d0fafe035d

View File

@ -378,8 +378,8 @@ done
shift $(( OPTIND - 1 ))
# Check for the command
command=$1
if [ -z $command ]; then
command="$1"
if [ -z "$command" ]; then
usage
fi
@ -391,17 +391,17 @@ shift
#
if [ ! -z "$RPMFILES" ]; then
process $command
process "$command"
if [ $# -gt 0 ]; then
usage
fi
else
if [ -z "$1" ]; then
process $command
process "$command"
else
while [ -n "$1" ]; do
FILEPATH="$1"
process $command
process "$command"
shift
done
fi