commit | 96b972aa3d15317cc1e853543a918b2b727e4566 | [log] [tgz] |
---|---|---|
author | Subhaditya Nath <sn03.general@gmail.com> | Mon Feb 06 20:38:47 2023 +0530 |
committer | Herbert Xu <herbert@gondor.apana.org.au> | Sat Apr 06 15:34:33 2024 +0800 |
tree | 42df89947434203e5bb667c904a5f9891d9443d4 | |
parent | 933e016f29ffd4863b9b2857d240716f7b2728b5 [diff] |
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. Test: getopts :a opt -: echo $opt$OPTARG Correct output - ?: Invalid output - : Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>