Merge pull request #1778 from tlaurion/fix_whiptail_color_output_remnants_bug

oem-factory-reset gui-init: fix whiptail_error segfaulting because selfcalling itself; fix typo in gui-init
This commit is contained in:
Thierry Laurion 2024-09-04 15:16:41 -04:00 committed by GitHub
commit b2264534a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -363,7 +363,7 @@ check_gpg_key()
option=$(cat /tmp/whiptail) option=$(cat /tmp/whiptail)
case "$option" in case "$option" in
g ) g )
gpg-gui.sh && BG_COLOR_MAIN_MENU="normnal" gpg-gui.sh && BG_COLOR_MAIN_MENU="normal"
;; ;;
i ) i )
skip_to_menu="true" skip_to_menu="true"

View File

@ -62,7 +62,7 @@ die() {
exit 1 exit 1
} }
whiptail_error() { local_whiptail_error() {
local msg=$1 local msg=$1
if [ "$msg" = "" ]; then if [ "$msg" = "" ]; then
die "whiptail error: An error msg is required" die "whiptail error: An error msg is required"
@ -71,7 +71,7 @@ whiptail_error() {
} }
whiptail_error_die() { whiptail_error_die() {
whiptail_error "$@" local_whiptail_error "$@"
die die
} }
@ -1111,7 +1111,7 @@ if [ "$GPG_GEN_KEY_IN_MEMORY" = "n" -o "$GPG_GEN_KEY_IN_MEMORY_COPY_TO_SMARTCARD
echo -e "\nChecking for USB Security Dongle...\n" echo -e "\nChecking for USB Security Dongle...\n"
enable_usb enable_usb
if ! gpg --card-status >/dev/null 2>&1; then if ! gpg --card-status >/dev/null 2>&1; then
whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter." local_whiptail_error "Can't access USB Security Dongle; \nPlease remove and reinsert, then press Enter."
if ! gpg --card-status >/dev/null 2>/tmp/error; then if ! gpg --card-status >/dev/null 2>/tmp/error; then
ERROR=$(tail -n 1 /tmp/error | fold -s) ERROR=$(tail -n 1 /tmp/error | fold -s)
whiptail_error_die "Unable to detect USB Security Dongle:\n\n${ERROR}" whiptail_error_die "Unable to detect USB Security Dongle:\n\n${ERROR}"