From 60b9f3360930296c0f3e8b04672b8bf7468bedcb Mon Sep 17 00:00:00 2001 From: Burt P Date: Tue, 20 Mar 2018 17:43:30 -0500 Subject: vendor.c: try and reduce the likelihood of false matches * Rename struct members to be less ambiguous * Sort the list by length of match_string, longest first, so better matches match first * Add flag to force case-sensitive matching so that two or three-letter names don't match names that happen to have those letters in them Also, added ASUS and fixes #241. (https://github.com/lpereira/hardinfo/issues/241) Signed-off-by: Burt P --- includes/vendor.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'includes/vendor.h') diff --git a/includes/vendor.h b/includes/vendor.h index 778e2ea3..21d52562 100644 --- a/includes/vendor.h +++ b/includes/vendor.h @@ -21,13 +21,14 @@ typedef struct _Vendor Vendor; struct _Vendor { - char *id; + char *match_string; + int match_case; /* 0 = ignore case, 1 = match case*/ char *name; char *url; }; void vendor_init(void); -const gchar *vendor_get_name(const gchar *id); -const gchar *vendor_get_url(const gchar *id); +const gchar *vendor_get_name(const gchar *id_str); +const gchar *vendor_get_url(const gchar *id_str); #endif /* __VENDOR_H__ */ -- cgit v1.2.3