diff options
author | Dave Reisner <dreisner@archlinux.org> | 2012-02-15 22:50:51 -0500 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2012-02-16 17:31:16 -0600 |
commit | ca4142714137b16feabac09c4cda86b0a75036f8 (patch) | |
tree | 76706d41581a2f764ba9c51f4d5ae151bcedae6a /scripts/pacman-key.sh.in | |
parent | 242006933d31c88b844f8f8d0c2f0806763cc51f (diff) | |
download | pacman-ca4142714137b16feabac09c4cda86b0a75036f8.tar.xz |
parseopts: normalize options into an array
Modify parse_options logic to fill an array instead of printing parsed
options. Avoid eval like the plague. Because it is the plague.
Fixes bugs such as FS#28445.
Signed-off-by: Dave Reisner <dreisner@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'scripts/pacman-key.sh.in')
-rw-r--r-- | scripts/pacman-key.sh.in | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 45ece51b..4b678041 100644 --- a/scripts/pacman-key.sh.in +++ b/scripts/pacman-key.sh.in @@ -504,11 +504,11 @@ OPT_LONG="add::,config:,delete:,edit-key:,export::,finger::,gpgdir:" OPT_LONG+=",help,import:,import-trustdb:,init,keyserver:,list-keys::,list-sigs::" OPT_LONG+=",lsign-key:,populate::,recv-keys:,refresh-keys::,updatedb" OPT_LONG+=",verify:,version" -if ! OPT_TEMP="$(parse_options $OPT_SHORT $OPT_LONG "$@")"; then +if ! parse_options $OPT_SHORT $OPT_LONG "$@"; then echo; usage; exit 1 # E_INVALID_OPTION; fi -eval set -- "$OPT_TEMP" -unset OPT_SHORT OPT_LONG OPT_TEMP +set -- "${OPTRET[@]}" +unset OPT_SHORT OPT_LONG OPTRET if [[ $1 == "--" ]]; then usage; |