From 8546e4b64bf2e05613c26d1e7f797adabe23481a Mon Sep 17 00:00:00 2001 From: Burt P Date: Thu, 4 Oct 2018 20:53:07 -0500 Subject: vendor.c: remove duplicate code, use vendor_match(), make *_name() result consistent Following the old behavior of returning the passed-in string if not found. Signed-off-by: Burt P --- modules/devices.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'modules') diff --git a/modules/devices.c b/modules/devices.c index 90a7b89b..85e5c932 100644 --- a/modules/devices.c +++ b/modules/devices.c @@ -372,7 +372,7 @@ gchar *get_motherboard(void) if (board_vendor) { /* attempt to shorten */ tmp = vendor_get_shortest_name(board_vendor); - if (tmp) { + if (tmp && tmp != board_vendor) { g_free(board_vendor); board_vendor = g_strdup(tmp); } @@ -384,7 +384,7 @@ gchar *get_motherboard(void) if (product_vendor) { /* attempt to shorten */ tmp = vendor_get_shortest_name(product_vendor); - if (tmp) { + if (tmp && tmp != product_vendor) { g_free(product_vendor); product_vendor = g_strdup(tmp); } -- cgit v1.2.3