From 72104ea10a26d4b4ff245ed60c5ccd5c043c5fe0 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 May 2017 11:01:23 +0200 Subject: [PATCH] libnm: ignore phrases in fixup device description only when delimited by space --- libnm/nm-device.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libnm/nm-device.c b/libnm/nm-device.c index 6c27190783..3a6052bd9c 100644 --- a/libnm/nm-device.c +++ b/libnm/nm-device.c @@ -1507,7 +1507,11 @@ fixup_desc_string (const char *desc) if (p) { const char *eow = &p[strlen (IGNORED_PHRASES[i])]; - memmove (p, eow, strlen (eow) + 1); /* +1 for the \0 */ + /* require that the phrase is delimited by space, or + * at the beginning or end of the description. */ + if ( (p == desc_full || p[-1] == ' ') + && NM_IN_SET (eow[0], '\0', ' ')) + memmove (p, eow, strlen (eow) + 1); /* +1 for the \0 */ } }