From: "Zeeshan Ali (Khattak)" <[email protected]>

If both pattern and string are NULL, they should match.
---
 osinfo/osinfo_db.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/osinfo/osinfo_db.c b/osinfo/osinfo_db.c
index 4394dcf..d9ec6e3 100644
--- a/osinfo/osinfo_db.c
+++ b/osinfo/osinfo_db.c
@@ -30,8 +30,9 @@ G_DEFINE_TYPE (OsinfoDb, osinfo_db, G_TYPE_OBJECT);
 
 #define OSINFO_DB_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), 
OSINFO_TYPE_DB, OsinfoDbPrivate))
 
-#define match_regex(pattern, str) ((pattern) && (str) && \
-                                   g_regex_match_simple((pattern), (str), 0, 
0))
+#define match_regex(pattern, str) (((pattern) == NULL && (str) == NULL) || \
+                                   ((pattern) != NULL && (str) != NULL && \
+                                    g_regex_match_simple((pattern), (str), 0, 
0)))
 
 /**
  * SECTION:osinfo_db
-- 
1.7.7.1

_______________________________________________
virt-tools-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/virt-tools-list

Reply via email to