dns_baidu, dns_bhosted: pipe input to _lower_case, not an argument

_lower_case reads stdin only. Called as _lower_case "$x", the argument
was dropped and tr read the inherited stdin. On an interactive tty that
never reaches EOF, so dns_baidu hung forever on every add/rm (#7319).
Under cron stdin is /dev/null and the value came back empty: dns_baidu
fell into the default engine order by luck, and the dns_bhosted
fallback error checks could never match.

Fixes #7319
This commit is contained in:
neil committed 2026-10-12 17:02:10 +08:00
1 parent 3e6d4835e5
commit cf51ad22d1
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -120,7 +120,7 @@ _baidu_run_with_fallback() {
}
_baidu_engine_order() {
_pref="$(_lower_case "$(_baidu_trim_ws "${Baidu_API_Preference:-auto}")")"
_pref="$(_baidu_trim_ws "${Baidu_API_Preference:-auto}" | _lower_case)"
case "$_pref" in
legacy)
printf "%s" "legacy new"
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.