From cfb80376641fa49137b9996130352697e7f8b436 Mon Sep 17 00:00:00 2001 From: Sebastien Bacher Date: Wed, 25 Aug 2021 15:23:22 +0200 Subject: New upstream version 1.32.10 --- src/libnm-client-impl/nm-libnm-utils.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/libnm-client-impl/nm-libnm-utils.c') diff --git a/src/libnm-client-impl/nm-libnm-utils.c b/src/libnm-client-impl/nm-libnm-utils.c index 3cc88ef4..671466cf 100644 --- a/src/libnm-client-impl/nm-libnm-utils.c +++ b/src/libnm-client-impl/nm-libnm-utils.c @@ -160,14 +160,17 @@ _fixup_string(const char * desc, p = q + 1; } - /* replace '_', ',', ASCII control characters and parentheses, with space. */ + /* replace '_', ',', ASCII control characters and everything inside parentheses, with space. */ for (p = desc_full; p[0]; p++) { if (*p == '(') in_paren = TRUE; - if (NM_IN_SET(*p, '_', ',') || *p < ' ' || in_paren) - *p = ' '; - if (*p == ')') + else if (*p == ')') in_paren = FALSE; + else if (NM_IN_SET(*p, '_', ',') || nm_ascii_is_ctrl_or_del(*p) || in_paren) { + /* pass */ + } else + continue; + *p = ' '; } /* Attempt to shorten ID by ignoring certain phrases */ -- cgit 1.3.0-6-gf8a5