From ee12f46f45cd2dd6a7638d1bdc6534301a9c55ba Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Tue, 29 Aug 2023 17:27:19 +0200 Subject: [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. --- gdb/testsuite/lib/gdb.exp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'gdb/testsuite/lib/gdb.exp') diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index bcf536e..1b91794 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 } -- cgit v1.1