options: Fix getopts handling of colon in optstr

Putting a colon at the beginning of optstring to silence errors doesn't
mean that the colon is a valid option. Before this patch, dash treated
-: as a valid option if the optstring started with a colon. This patch
fixes that problem.


    getopts :a opt -:
    echo $opt$OPTARG

Correct output - ?:
Invalid output - :

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 file changed