aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2018-10-04 20:53:07 -0500
committerLeandro A. F. Pereira <leandro@hardinfo.org>2018-11-04 15:02:12 -0800
commit8546e4b64bf2e05613c26d1e7f797adabe23481a (patch)
treeecc7f9db4f68e25b883ebc5e9848e3e5e49e7cac /modules
parentc98b4d5f8254882df4ddc96df406de8d45263e99 (diff)
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 <pburt0@gmail.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/devices.c4
1 files changed, 2 insertions, 2 deletions
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);
}