From ca4142714137b16feabac09c4cda86b0a75036f8 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 15 Feb 2012 22:50:51 -0500 Subject: 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 Signed-off-by: Dan McGee --- scripts/pacman-key.sh.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/pacman-key.sh.in') 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; -- cgit v1.2.3-54-g00ecf