mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-27 22:10:09 +01:00
libnm: use nm_ascii_is_ctrl_or_del() in nm_utils_fixup_product_string() to preserve UTF-8
On architectures where "char" is signed, the check "ch < ' '" is also
TRUE for characters greater than 127 (that is, UTF-8 characters).
Let's preserve valid UTF-8 characters and don't clear them.
Also note that already before we filtered out invalid UTF-8 sequences,
so if we encounter here a character > 127, it is part of a valid UTF-8
sequence.
(cherry picked from commit fb3e6cb0dc)
This commit is contained in:
parent
e3cfd14851
commit
e03587f9b0
1 changed files with 1 additions and 1 deletions
|
|
@ -166,7 +166,7 @@ _fixup_string(const char * desc,
|
|||
in_paren = TRUE;
|
||||
else if (*p == ')')
|
||||
in_paren = FALSE;
|
||||
else if (NM_IN_SET(*p, '_', ',') || *p < ' ' || in_paren) {
|
||||
else if (NM_IN_SET(*p, '_', ',') || nm_ascii_is_ctrl_or_del(*p) || in_paren) {
|
||||
/* pass */
|
||||
} else
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue