From: Tom de Vries Date: Tue, 29 Aug 2023 15:27:19 +0000 (+0200) Subject: [gdb/testsuite] Fix false negative in have_host_locale X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ee12f46f45cd2dd6a7638d1bdc6534301a9c55ba;p=binutils-gdb.git [gdb/testsuite] Fix false negative in have_host_locale In test-case gdb.tui/pr30056.exp we check for: ... require {have_host_locale C.UTF-8} ... The "C.UTF-8" is normalized by have_host_locale to "c.utf8", before trying to find it in the list returned by host_locales. On my development platform, "locale -a" lists C.utf8, which is normalized to "c.utf8" by host_locales, so there's a match and have_host_locale returns true. On another platform however, "locale -a" lists C.UTF-8, which is normalized to "c.utf-8" by host_locales, so there's no match and have_host_locale returns false. Fix this by also dropping the dash in host_locales. Tested on x86_64-linux. --- diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index bcf536e0cc5..1b9179401c4 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -9936,6 +9936,8 @@ gdb_caching_proc host_locales { } { # Normalize items to lower-case. set l [lmap v $l { string tolower $v }] + # Normalize items to without dash. + set l [lmap v $l { string map { "-" "" } $v }] return $l }