diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2021-08-25 15:23:22 +0200 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2021-08-25 15:23:22 +0200 |
| commit | cfb80376641fa49137b9996130352697e7f8b436 (patch) | |
| tree | 4ac3eb90a08f27a8bff2372052f8ae78f7e7c3aa /src/libnm-client-impl/nm-libnm-utils.c | |
| parent | 35779c6675728fa6f0fd0a21cefb904408509c23 (diff) | |
New upstream version 1.32.10
Diffstat (limited to 'src/libnm-client-impl/nm-libnm-utils.c')
| -rw-r--r-- | src/libnm-client-impl/nm-libnm-utils.c | 11 |
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 */ |