about summary refs log tree commit diff
path: root/src/libnm-client-impl/nm-libnm-utils.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2021-08-25 15:24:42 +0200
committerSebastien Bacher <seb128@ubuntu.com>2021-08-25 15:24:42 +0200
commitdbb91282fa488964fb20595f9494a9f0e4f36a58 (patch)
tree142bc942e5320b35514cdf03a5f9f47a9b89df0e /src/libnm-client-impl/nm-libnm-utils.c
parent5f2ede3a2813b0e9204befdcfc67509d34be71c6 (diff)
parentcfb80376641fa49137b9996130352697e7f8b436 (diff)
Update upstream source from tag 'upstream/1.32.10'
Update to upstream version '1.32.10'
with Debian dir fcf2778b50b013ede3e7375bc1d829e984175658
Diffstat (limited to 'src/libnm-client-impl/nm-libnm-utils.c')
-rw-r--r--src/libnm-client-impl/nm-libnm-utils.c11
1 files changed, 7 insertions, 4 deletions
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 */