Fix https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=246192
To reproduce the problem setting to true if [ ! "$NETWORKS" ]; then in bsdinstall/scripts/wlanconfig to simulate an empty network list, so with the NO button the script "exit 1" and avoids to set up hidden networks and more.
Replacing "exit 1" with an "else" the DIALOG_CANCEL is matched by the case of the menu so the configuration can proceed.
Off topic / future improvement:
Open the "manual configuration" with a NO/Cancel button is not intuitive, currently dialog does not support menus with zero items so we need the 2 dialogs "if --yesno else --menu".
bsddialog provides already this feature so we could provide only 1 dialog more intuitive in the future:
bsddialog --title "Network Selection" --ok-label Select --extra-button --extra-label Rescan --cancel-label Manual --help-button --help-label Finish --menu "\nSelect a wireless network to connect to." 0 0 0 Network1 "[WEP]" Network2 "[WPA]" Network3 "[ESS]" ┌────────────┤Network Selection├────────────┐ │ │ │ Select a wireless network to connect to. │ │ ┌───────────────────────────────────────┐ │ │ │ Network1 [WEP] │ │ │ │ Network2 [WPA] │ │ │ │ Network3 [ESS] │ │ │ └───────────────────────────────────────┘ │ ├───────────────────────────────────────────┤ │ [Select] [Rescan] [Manual] [Finish] │ └───────────────────────────────────────────┘