diff --git a/libnm/nm-libnm-utils.c b/libnm/nm-libnm-utils.c index 7ecf63b4ae..d8e8d3f7e5 100644 --- a/libnm/nm-libnm-utils.c +++ b/libnm/nm-libnm-utils.c @@ -233,10 +233,21 @@ nm_utils_fixup_vendor_string (const char *desc) NULL, }; char *desc_full; + char *p; desc_full = _fixup_string (desc, IGNORED_PHRASES, IGNORED_WORDS, TRUE); - if (desc_full) - nm_assert (g_utf8_validate (desc_full, -1, NULL)); + if (!desc_full) + return NULL; + + /* Chop off everything after a slash. */ + for (p = desc_full; *p; p++) { + if ((p[0] == ' ' && p[1] == '/') || p[0] == '/') { + p[0] = '\0'; + break; + } + } + + nm_assert (g_utf8_validate (desc_full, -1, NULL)); return desc_full; } diff --git a/libnm/tests/test-general.c b/libnm/tests/test-general.c index 2483579bed..e9afce86bd 100644 --- a/libnm/tests/test-general.c +++ b/libnm/tests/test-general.c @@ -199,6 +199,7 @@ test_fixup_vendor_string (void) T (nm_utils_fixup_vendor_string, "Logitec Corp.", "Logitec"); T (nm_utils_fixup_vendor_string, "Logitech, Inc.", "Logitech"); T (nm_utils_fixup_vendor_string, "LSI Corporation", "LSI"); + T (nm_utils_fixup_vendor_string, "LSI Logic / Symbios Logic", "LSI Logic"); T (nm_utils_fixup_vendor_string, "Macronix, Inc. [MXIC]", "MXIC"); T (nm_utils_fixup_vendor_string, "Marvell Semiconductor, Inc.", "Marvell"); T (nm_utils_fixup_vendor_string, "Marvell Technology Group Ltd.", "Marvell"); @@ -242,6 +243,7 @@ test_fixup_vendor_string (void) T (nm_utils_fixup_vendor_string, "OpenMoko, Inc.", "OpenMoko"); T (nm_utils_fixup_vendor_string, "Option", "Option"); T (nm_utils_fixup_vendor_string, "OQO", "OQO"); + T (nm_utils_fixup_vendor_string, "Oracle/SUN", "Oracle"); T (nm_utils_fixup_vendor_string, "Ovislink Corp.", "Ovislink"); T (nm_utils_fixup_vendor_string, "Packet Engines Inc.", "Packet Engines"); T (nm_utils_fixup_vendor_string, "Panasonic (Matsushita)", "Panasonic"); @@ -264,6 +266,7 @@ test_fixup_vendor_string (void) T (nm_utils_fixup_vendor_string, "Qualcomm Atheros Communications", "Qualcomm Atheros"); T (nm_utils_fixup_vendor_string, "Qualcomm Atheros", "Qualcomm Atheros"); T (nm_utils_fixup_vendor_string, "Qualcomm, Inc.", "Qualcomm"); + T (nm_utils_fixup_vendor_string, "Qualcomm / Option", "Qualcomm"); T (nm_utils_fixup_vendor_string, "Quanta Computer, Inc.", "Quanta Computer"); T (nm_utils_fixup_vendor_string, "Quanta Microsystems, Inc.", "Quanta"); T (nm_utils_fixup_vendor_string, "Quantenna Communications, Inc.", "Quantenna"); @@ -297,6 +300,7 @@ test_fixup_vendor_string (void) T (nm_utils_fixup_vendor_string, "Standard Microsystems Corp [SMC]", "SMC"); T (nm_utils_fixup_vendor_string, "Standard Microsystems Corp.", "Standard"); T (nm_utils_fixup_vendor_string, "STMicroelectronics", "STMicroelectronics"); + T (nm_utils_fixup_vendor_string, "Sundance Technology Inc / IC Plus Corp", "Sundance"); T (nm_utils_fixup_vendor_string, "Surecom Technology Corp.", "Surecom"); T (nm_utils_fixup_vendor_string, "Surecom Technology", "Surecom"); T (nm_utils_fixup_vendor_string, "Sweex", "Sweex");