mirror of
https://git.proxmox.com/git/fwupd
synced 2025-05-29 04:52:15 +00:00
trivial: Strip leading and trailing spaces from the vendor name
This commit is contained in:
parent
e3583793ed
commit
adfef91731
@ -2255,7 +2255,14 @@ fu_device_fixup_vendor_name(FuDevice *self)
|
||||
void
|
||||
fu_device_set_vendor(FuDevice *self, const gchar *vendor)
|
||||
{
|
||||
fwupd_device_set_vendor(FWUPD_DEVICE(self), vendor);
|
||||
g_autofree gchar *vendor_safe = NULL;
|
||||
|
||||
/* trim any leading and trailing spaces */
|
||||
if (vendor != NULL)
|
||||
vendor_safe = fu_common_strstrip(vendor);
|
||||
|
||||
/* proxy */
|
||||
fwupd_device_set_vendor(FWUPD_DEVICE(self), vendor_safe);
|
||||
fu_device_fixup_vendor_name(self);
|
||||
}
|
||||
|
||||
|
@ -263,7 +263,7 @@ fu_device_name_func(void)
|
||||
g_autoptr(FuDevice) device2 = fu_device_new();
|
||||
|
||||
/* vendor then name */
|
||||
fu_device_set_vendor(device1, "Hughski");
|
||||
fu_device_set_vendor(device1, " Hughski ");
|
||||
fu_device_set_name(device1, "HUGHSKI ColorHug(TM)__Pro ");
|
||||
g_assert_cmpstr(fu_device_get_vendor(device1), ==, "Hughski");
|
||||
g_assert_cmpstr(fu_device_get_name(device1), ==, "ColorHug™ Pro");
|
||||
|
Loading…
Reference in New Issue
Block a user